/* KENI-BILL UI polish 2026-11-01 */
:root {
  --font-ui: "Inter", "SF Pro Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body {
  font-family: var(--font-ui);
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: -.003em;
  padding-bottom: env(safe-area-inset-bottom);
}

body.staff-noc,
body.staff-login,
body.portal-noc {
  font-family: var(--font-ui);
}

h1, h2, h3 {
  text-wrap: balance;
  letter-spacing: -.025em;
}

h1 { line-height: 1.12; }
h2 { line-height: 1.25; }

a { text-underline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

.mono, code, .customer-meta b, .fact .v.mono {
  font-family: var(--font-mono);
}

.kpi, .ops-metric strong, .dash-kpi-value,
.customer-balance .sum, .money-pos, .money-neg,
table td.money, .finance-kpi .kpi {
  font-variant-numeric: tabular-nums;
}

/* Navigation */
.side-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 10px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  z-index: 2;
  color: #c4d8ef;
  background: rgba(255,255,255,.06);
}

.side-close:hover {
  color: #fff;
  background: rgba(255,255,255,.14);
}

.side-nav a[aria-current="page"] {
  font-weight: 700;
}

.side-nav a.active svg {
  color: currentColor;
}

.topbar-title {
  letter-spacing: -.015em;
}

.topbar {
  backdrop-filter: blur(18px) saturate(1.15);
}

/* Compact top navigation on small screens */
@media (max-width: 820px) {
  .side-close { display: inline-flex; }
  .side-brand { padding-right: 42px; }
  .sidebar { padding-top: 16px; }
  .side-nav a { min-height: 44px; }
  .side-nav a.active { box-shadow: inset 3px 0 0 #22d3ee; }
}

/* Dashboard */
.ops-summary {
  border-radius: 16px;
  margin-bottom: 14px;
}

.ops-metric {
  position: relative;
  gap: 3px;
  padding: 15px 15px 14px;
  min-height: 116px;
  transition: background .18s, color .18s;
}

.ops-metric:hover { background: var(--panel-2); }
.ops-metric > .ops-icon + strong { margin-top: 4px; }

.ops-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  margin-bottom: 4px;
  border-radius: 9px;
  color: var(--accent) !important;
  background: var(--accent-soft);
  font-size: 12.5px !important;
}

.ops-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-icon-good { color: var(--good) !important; background: var(--good-soft); }
.ops-icon-warn { color: var(--warn) !important; background: var(--warn-soft); }
.ops-icon-bad { color: var(--bad) !important; background: var(--bad-soft); }

.ops-metric strong {
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.ops-metric > strong + span {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}

.ops-metric > small {
  margin-top: -1px;
  font-size: 11.5px;
  line-height: 1.3;
}

.ops-grid {
  gap: 14px;
}

.ops-card {
  min-height: 100%;
}

.ops-card .card-head {
  padding-bottom: 2px;
}

.ops-card .card-head h2 {
  margin-bottom: 2px;
}

.ops-card .card-head p {
  margin: 0;
}

.ops-card .card-head > a {
  font-size: 12px;
  white-space: nowrap;
}

.ops-list {
  margin-top: 4px;
}

.ops-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.ops-row:last-child { border-bottom: 0; }
.ops-row > .badge { flex: 0 0 auto; margin-top: 2px; }
.ops-row > .avatar { flex: 0 0 auto; width: 31px; height: 31px; }
.ops-row b { line-height: 1.3; }
.ops-row strong { font-weight: 750; }

.ops-calm {
  display: grid;
  gap: 2px;
  padding: 14px 0 10px;
}

.ops-shift {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.ops-shift:hover { text-decoration: none; border-color: var(--accent); }
.ops-shift > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; flex: 1; }
.ops-shift b { font-size: 12.5px; }
.ops-shift small { color: var(--muted); font-size: 11px; }
.ops-shift > a, .ops-shift-link > span:last-child { color: var(--accent); font-size: 12px; white-space: nowrap; }

.ops-money-totals {
  margin: 2px 0 4px;
  gap: 7px;
}

.ops-money-totals > div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.ops-money-totals b { font-size: 15px; }

/* Customer list */
.customer-filters {
  margin-bottom: 0;
}

.customer-search {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-search .filter-search {
  position: relative;
  flex: 1 1 340px;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.customer-search .filter-search svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.customer-search .filter-search input {
  padding-left: 36px;
}

.customer-search select {
  flex: 0 1 205px;
  min-width: 145px;
}

.customer-search .btn.small {
  margin-left: 1px;
}

.customer-list-card {
  padding-top: 4px;
}

.customer-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.customer-name:hover { color: var(--accent); text-decoration: none; }
.customer-name > span:last-child { display: grid; gap: 1px; min-width: 0; }
.customer-name b { font-weight: 650; overflow-wrap: anywhere; }
.customer-name small { color: var(--muted); font-size: 11.5px; }
.customer-name .avatar { width: 33px; height: 33px; font-size: 11px; }

.customer-table td[data-label="Баланс"] {
  font-weight: 700;
  white-space: nowrap;
}

.customer-table td[data-label="Действия"] .row {
  flex-wrap: nowrap;
}

.empty-state {
  display: grid;
  gap: 3px;
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
}

.empty-state b { color: var(--text); font-size: 14px; }
.empty-state span { font-size: 12.5px; }

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Customer card */
.customer-head {
  border-radius: 18px;
  padding: 20px 22px;
  overflow: hidden;
}

.customer-identity { gap: 15px; }
.person-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 17px;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.customer-balance {
  min-width: 245px;
}

.customer-balance .sum {
  font-size: 2rem;
}

.customer-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.customer-facts > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}

.customer-facts span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.customer-facts b { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.customer-facts small { color: var(--muted); font-size: 11.5px; }

.customer-tabs {
  scrollbar-width: none;
}

.customer-tabs::-webkit-scrollbar { display: none; }

.customer-tabs button {
  transition: color .15s, border-color .15s, background .15s;
}

.customer-tabs button.is-active {
  font-weight: 700;
}

.service-summary {
  padding: 12px 0 0;
}

.service-summary:first-of-type { padding-top: 0; }
.service-summary + .service-summary { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }

.service-summary > .service-summary-top strong { font-size: 14px; }

.fact-grid {
  gap: 8px;
}

.fact {
  border-radius: 9px;
  background: var(--panel-2);
}

.fact .k { letter-spacing: .06em; }

/* Finance */
.finance-filter {
  margin-bottom: 14px;
}

.finance-kpi {
  min-height: 128px;
}

.finance-kpi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.finance-kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.finance-kpi-icon.good { color: var(--good); background: var(--good-soft); }
.finance-kpi-icon.bad { color: var(--bad); background: var(--bad-soft); }
.finance-kpi-icon.warn { color: var(--warn); background: var(--warn-soft); }
.finance-kpi-icon.accent { color: var(--accent); background: var(--accent-soft); }
.finance-kpi .kpi { margin-top: 8px; }
.finance-kpi .small { margin-top: 2px; }

.finance-tables .card { min-width: 0; }

/* Network */
.map-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.map-stat {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-stat span { color: var(--muted); font-size: 11.5px; font-weight: 650; }
.map-stat b { font-size: 22px; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.map-stat small { color: var(--muted); font-size: 11.5px; }

.network-map-card { margin-top: 0; }
.network-map-board { margin-top: 12px; }
.network-site-row { padding: 12px; border-radius: 13px; }
.network-site-label b { font-size: 14px; }
.network-router-node { min-height: 54px; border-radius: 11px; }
.network-router-node:hover { text-decoration: none; }
.network-router-node > .badge { flex: 0 0 auto; font-size: 10.5px; }
.network-ubnt-node { min-height: 54px; border-radius: 11px; }
.network-ubnt-mark { color: var(--accent); background: var(--accent-soft); }
.network-map-footer { margin-top: 12px; }
.network-footer-item { color: var(--muted); }
.network-footer-item:hover { color: var(--accent); }

/* Mobile */
@media (max-width: 1100px) {
  .map-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .customer-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .customer-tabs {
    position: sticky;
    top: 58px;
    z-index: 22;
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
  }

  .customer-tabs button { min-height: 42px; }
  .customer-facts { gap: 7px; }
  .customer-search { display: grid; grid-template-columns: 1fr; }
  .customer-search .filter-search,
  .customer-search select,
  .customer-search button,
  .customer-search .btn { width: 100%; max-width: none; min-width: 0; }
  .customer-search .btn.small { margin: 0; }
  .customer-table .customer-name { gap: 8px; }
  .customer-table td[data-label="Действия"] .row { flex-wrap: wrap; }
  .customer-table td[data-label="Действия"] .btn { flex: 1 1 auto; }
  .ops-metric { min-height: 108px; padding: 12px; }
  .ops-metric strong { font-size: 20px; }
  .ops-card { padding: 13px; }
  .ops-row { padding: 8px 0; }
  .finance-kpi { min-height: 0; }
  .finance-kpi-head { font-size: 12.5px; }
  .finance-kpi-icon { width: 25px; height: 25px; }
  .finance-tables { gap: 12px; }
  .network-site-row { gap: 8px; }
  .network-router-node,
  .network-ubnt-node { min-height: 48px; }
  .network-ubnt-node { display: none; }
}

@media (max-width: 520px) {
  .customer-head { padding: 14px; }
  .person-avatar { width: 46px; height: 46px; margin-bottom: 9px; }
  .customer-facts { grid-template-columns: 1fr 1fr; }
  .customer-facts > div { padding: 9px 10px; }
  .customer-facts b { font-size: 14px; }
  .ops-summary { grid-template-columns: 1fr 1fr; }
  .ops-metric:nth-child(2n) { border-right: 0; }
  .ops-metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .ops-metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .map-summary { gap: 7px; }
  .map-stat { padding: 10px; }
  .map-stat b { font-size: 19px; }
  .finance-kpi .kpi { font-size: 21px; }
}

@media (max-width: 380px) {
  .customer-facts { grid-template-columns: 1fr; }
  .ops-summary { grid-template-columns: 1fr; }
  .ops-metric { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .ops-metric:last-child { border-bottom: 0; }
}

/* Light sidebar close control */
html[data-theme="light"] .side-close {
  color: var(--muted);
  background: var(--bg-soft);
}
html[data-theme="light"] .side-close:hover {
  color: var(--text);
  background: var(--line);
}

/* Make the dashboard summary and card tables breathe on large screens */
@media (min-width: 1300px) {
  .ops-summary .ops-metric { padding: 17px 17px 15px; }
  .ops-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr) minmax(0, 1fr); }
}

/* Dashboard: recent customers + network/server aside */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr);
  gap: 14px;
  align-items: start;
}

.dash-main { display: grid; gap: 14px; min-width: 0; }
.dash-aside { display: grid; gap: 14px; min-width: 0; }
.dash-middle { gap: 14px; }

.recent-customers-card { padding-bottom: 10px; }
.recent-customer-list { display: grid; gap: 0; }
.recent-customer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.recent-customer-row:last-child { border-bottom: 0; }
.recent-customer-row:hover { color: var(--accent); text-decoration: none; }
.recent-customer-row .avatar { flex: 0 0 auto; width: 36px; height: 36px; font-size: 12px; }
.recent-customer-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.recent-customer-copy b { font-size: 14px; overflow-wrap: anywhere; }
.recent-customer-copy small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.recent-customer-service { flex: 0 0 auto; }
.recent-customer-row > strong { flex: 0 0 auto; font-size: 13.5px; white-space: nowrap; }

.network-panel { overflow: hidden; }
.network-panel-list { display: grid; gap: 0; }
.network-panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.network-panel-row:last-child { border-bottom: 0; }
.network-panel-row:hover { color: var(--accent); text-decoration: none; }
.network-panel-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.network-panel-copy b { font-size: 12.5px; overflow-wrap: anywhere; }
.network-panel-copy small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.network-panel-row > .badge { flex: 0 0 auto; font-size: 10.5px; }
.network-panel-load {
  display: block;
  width: 48px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
  flex: 0 0 auto;
}
.network-panel-load i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.server-block, .ubnt-main-block { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.server-block-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.server-block-title .muted { font-size: 10.5px; font-weight: 500; }
.server-metric { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 6px; margin: 5px 0; font-size: 11.5px; color: var(--muted); }
.server-metric b { color: var(--text); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.server-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: var(--line); }
.server-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.server-metric:nth-of-type(2) .server-bar i { background: linear-gradient(90deg, var(--good), var(--accent-2)); }
.server-note { margin-top: 7px; color: var(--muted); font-size: 10.5px; }
.ubnt-empty { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.money-panel { padding-bottom: 12px; }
.money-panel-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.money-panel-row b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.money-panel-link { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--accent); font-size: 11.5px; text-decoration: none; }
.money-panel-link:hover { text-decoration: none; color: var(--accent); }

@media (max-width: 1050px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dash-aside { grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr); align-items: start; }
}
@media (max-width: 700px) {
  .dash-aside { grid-template-columns: 1fr; }
  .recent-customer-service { display: none; }
  .recent-customer-row > strong { font-size: 12px; }
}
@media (max-width: 430px) {
  .recent-customer-row { gap: 8px; }
  .recent-customer-row .avatar { width: 32px; height: 32px; }
  .recent-customer-copy b { font-size: 13px; }
  .recent-customer-copy small { font-size: 11px; }
}

/* Customer network tab: clear blocks instead of a mixed chain */
.network-service-list { display: grid; gap: 12px; }
.network-service-card { padding: 16px 18px; }
.network-service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.network-service-head h2 { margin: 0 0 2px; }
.network-service-head p { margin: 0; }
.network-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.network-block { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.network-block h3 { margin: 0 0 8px; color: var(--text); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.network-facts { display: grid; gap: 0; margin: 0; }
.network-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.network-facts > div:last-child { border-bottom: 0; }
.network-facts dt { color: var(--muted); font-size: 11.5px; }
.network-facts dd { margin: 0; text-align: right; font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .network-service-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .network-service-card { padding: 13px; }
  .network-service-head { gap: 8px; }
  .network-service-head h2 { font-size: 15px; }
}

/* Password tools in forms */
.password-tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.password-tools .btn { min-height: 30px; }

/* Modules page */
.module-groups { display: grid; gap: 12px; }
.module-group { padding: 16px; }
.module-description { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.module-row { align-items: center; gap: 16px; padding: 12px 13px; }
.module-row .module-title { margin-bottom: 1px; }
.module-row form { flex: 0 0 auto; }
@media (max-width: 700px) {
  .module-row { align-items: stretch; flex-direction: column; }
  .module-row form button { width: 100%; }
}

/* Audit */
.audit-details summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.audit-json { margin-top: 8px; }
.audit-json > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.audit-json pre { max-height: 260px; overflow: auto; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); font: 11px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Finance: equal cards in a calm 3-column grid */
.finance-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.finance-kpis .finance-kpi {
  display: flex;
  flex-direction: column;
  min-height: 136px;
}
.finance-kpi .kpi { margin-top: auto; }
@media (max-width: 1000px) {
  .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .finance-kpis { grid-template-columns: 1fr; }
  .finance-kpis .finance-kpi { min-height: 0; }
}

/* Readable typography across the cabinet */
body { font-size: 16.5px; line-height: 1.55; }
.small { font-size: 13px; }
.help, .form-field .help, .form-field .help { font-size: 13px; }
.workspace-meta, .page-head p, .card-head p { font-size: 13px; }
.side-nav a { font-size: 14.5px; }
.nav-group { font-size: 10.5px; }
.topbar-title { font-size: 15.5px; }
table { font-size: 14px; }
th { font-size: 12px; }
th, td { padding-top: 10px; padding-bottom: 10px; }
.card h2, .panel-title h2 { font-size: 1.12rem; }
.fact .k { font-size: 10px; }
.fact .v { font-size: 13px; }
.customer-meta, .info-row { font-size: 12.5px; }
.customer-tabs button { font-size: 14px; }
.badge { font-size: 12px; }
@media (max-width: 820px) {
  body { font-size: 16px; }
  table { font-size: 13.5px; }
  .small { font-size: 12.5px; }
}

/* Customer live session status */
.customer-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}
.customer-live-status .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); flex: 0 0 auto; }
.customer-live-status.is-error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); color: var(--bad); }
.customer-live-status.is-error .live-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.traffic-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.traffic-summary > div { display: grid; gap: 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.traffic-summary span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.traffic-summary b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .traffic-summary { grid-template-columns: 1fr; }
}

.traffic-history { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.traffic-history > summary { color: var(--accent); cursor: pointer; font-size: 12.5px; }
.traffic-history .table-wrap { margin-top: 8px; }
/* KENI-BILL / Шел-Сервис — компактная дизайн-система 2026.11 */
:root {
  --kb-space-1: 4px;
  --kb-space-2: 8px;
  --kb-space-3: 12px;
  --kb-space-4: 16px;
  --kb-space-5: 20px;
  --kb-radius: 12px;
  --kb-radius-sm: 8px;
  --kb-body: 14.5px;
  --kb-small: 12.5px;
  --kb-label: 12px;
  --kb-h1: 27px;
  --kb-h2: 17px;
  --kb-h3: 14.5px;
  --kb-table: 13px;
  --kb-th: 11.5px;
  --kb-control: 38px;
  --kb-control-sm: 30px;
}

html { overflow-x: clip; }
body {
  font-size: var(--kb-body);
  line-height: 1.45;
  letter-spacing: 0;
  overflow-x: clip;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}
body.staff-noc, body.portal-noc, body.staff-login { font-size: var(--kb-body); }
h1, h2, h3, h4 {
  letter-spacing: -.012em;
  line-height: 1.2;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}
h1 { font-size: var(--kb-h1); }
h2 { font-size: var(--kb-h2); }
h3 { font-size: var(--kb-h3); }
p, li, td, th, label, .badge, .btn, button { word-break: normal; overflow-wrap: break-word; hyphens: none; }
.mono, code, pre, [data-ip], [data-mac] { overflow-wrap: anywhere; word-break: break-word; }
.small { font-size: var(--kb-small); }
.help { font-size: var(--kb-small); overflow-wrap: break-word; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Типографика без искусственных пробелов */
.eyebrow, .workspace-eyebrow, .nav-group, .customer-facts span, .filter-field,
th, .fact .k, .service-fact > span, .promise-summary span, .network-block h3,
.traffic-summary span, .audit-json > span, .power-card .power-source, .stub-toolbar {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.eyebrow, .workspace-eyebrow { color: var(--muted); font-weight: 650; font-size: 11.5px; }
.workspace-meta, .page-head p, .card-head p { font-size: var(--kb-small); }

/* Каркас и плотность */
.wrap { width: 100%; max-width: 1500px; padding: 14px 20px 28px; }
.card {
  padding: var(--kb-space-3);
  border-radius: var(--kb-radius);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  animation: none;
  transition: border-color .15s;
}
body.staff-noc .card:hover, .card:hover { transform: none; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card + .card { margin-top: 10px; }
.card-head { align-items: center; margin-bottom: 8px; gap: 8px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; }
.grid { gap: 10px; }
.two-col { gap: 10px; }
.stack { gap: 10px; }
.page-head, .workspace-head {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: var(--kb-radius);
  align-items: center;
}
.page-head h1, .workspace-head h1 { margin: 1px 0 2px; font-size: var(--kb-h1); }
.page-head p, .workspace-meta { margin: 0; }
.page-actions, .head-actions { gap: 6px; }
.eyebrow { margin-bottom: 2px; }

/* Кнопки и поля */
.btn, button {
  min-height: var(--kb-control);
  padding: 6px 11px;
  border-radius: var(--kb-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}
.btn.small, button.small { min-height: var(--kb-control-sm); padding: 3px 8px; font-size: 12px; }
.btn.ghost, button.ghost { box-shadow: none; }
.btn:hover, button:hover { transform: none; box-shadow: none; }
body.staff-noc .btn:hover, body.staff-noc button:hover { transform: none; box-shadow: none; }
input, select, textarea {
  min-height: var(--kb-control);
  padding: 7px 9px;
  border-radius: var(--kb-radius-sm);
  font-size: 14px;
  line-height: 1.35;
}
textarea { min-height: 76px; }
label { margin: 8px 0 4px; font-size: var(--kb-label); }
.form-field > label { margin-bottom: 4px; font-size: 12.5px; }
.form-field .help { margin-top: 4px; }
.form-fields { gap: 10px; }
.form-actions { margin-top: 12px; }
form p { margin-bottom: 8px; }

/* Таблицы: компактные, без раздутых строк */
table, body.staff-noc table { font-size: var(--kb-table); }
th, td { padding: 7px 8px; vertical-align: middle; }
th, body.staff-noc th { font-size: var(--kb-th); letter-spacing: 0; text-transform: none; }
tbody tr:hover td { background: var(--hover, var(--panel-2)); }
.table-wrap { overflow-x: auto; max-width: 100%; }
.table-wrap table { min-width: 0; }
td .row, th .row { gap: 5px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.table-actions .btn, .table-actions button { min-height: 26px; padding: 2px 7px; font-size: 11.5px; }

/* Статусы */
.badge { padding: 2px 7px; font-size: 11.5px; line-height: 1.35; letter-spacing: 0; white-space: normal; }
.badge.good { animation: none; }
.site-dot { width: 7px; height: 7px; }
.site-dot.good { box-shadow: 0 0 0 3px var(--good-soft); }
.site-dot.bad { box-shadow: 0 0 0 3px var(--bad-soft); }

/* Навигация */
.sidebar { width: 218px; padding: 12px 9px; }
.app-main { margin-left: 218px; }
.side-brand { padding: 2px 7px 12px; gap: 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.brand-copy b { font-size: 15px; }
.brand-copy small { font-size: 9px; letter-spacing: 0; margin-top: 2px; }
.side-nav { gap: 1px; }
.side-nav a { min-height: 34px; padding: 6px 9px; gap: 8px; font-size: 13px; border-radius: 7px; }
.side-nav svg { width: 16px; height: 16px; }
.nav-group { padding: 9px 8px 2px; font-size: 10.5px; font-weight: 600; }
.app-main .topbar { height: 54px; padding: 7px 18px; }
.topbar-title { font-size: 14.5px; }
.top-search input { min-height: 34px; font-size: 13.5px; padding-top: 6px; padding-bottom: 6px; }
.top-actions { gap: 5px; }
.icon-btn { width: 34px; height: 34px; min-height: 34px; }
.avatar { width: 28px; height: 28px; font-size: 11px; }

/* Рабочий стол и карточки показателей */
.kb-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.kb-kpi {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--kb-radius-sm);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}
.kb-kpi:hover { text-decoration: none; border-color: var(--accent); }
.kb-kpi > span { color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.kb-kpi > b { font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kb-kpi > small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.kb-kpi.good > b { color: var(--good); }
.kb-kpi.bad > b { color: var(--bad); }
.kb-kpi.warn > b { color: var(--warn); }
.kb-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 10px; align-items: start; }
.kb-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.kb-stack { display: grid; gap: 10px; min-width: 0; }
.kb-list { display: grid; }
.kb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.kb-row:last-child { border-bottom: 0; }
.kb-row:hover { text-decoration: none; color: var(--accent); }
.kb-row-main { display: grid; gap: 1px; min-width: 0; flex: 1; }
.kb-row-main b { font-size: 12.5px; font-weight: 650; overflow-wrap: break-word; }
.kb-row-main small { color: var(--muted); font-size: 11px; line-height: 1.3; overflow-wrap: break-word; }
.kb-row-value { flex: 0 0 auto; white-space: nowrap; font-size: 12.5px; }
.kb-row .badge { flex: 0 0 auto; }
.kb-empty { padding: 12px 0; color: var(--muted); font-size: 12.5px; }
.kb-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kb-section-title h2 { margin: 0; }
.kb-section-title a { font-size: 11.5px; white-space: nowrap; }
.kb-muted-line { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.kb-meter { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.kb-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.kb-server-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 6px; margin: 5px 0; color: var(--muted); font-size: 11.5px; }
.kb-server-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.kb-server-row .kb-meter { grid-column: 1 / -1; }
.kb-alert { display: flex; align-items: flex-start; gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kb-alert:last-child { border-bottom: 0; }
.kb-alert > span:last-child { display: grid; gap: 1px; min-width: 0; }

/* Поиск и фильтры */
.kb-searchbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.kb-searchbar .filter-search { flex: 1 1 280px; min-width: 0; }
.kb-searchbar input { min-width: 0; }
.kb-searchbar select { flex: 0 1 180px; min-width: 120px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.kb-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.kb-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.kb-chip.is-active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.kb-chip .badge { padding: 0 5px; font-size: 10.5px; }
.filter-search { position: relative; display: flex; align-items: center; }
.filter-search > svg { position: absolute; left: 10px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
.filter-search input { padding-left: 33px; }
.filter-search input::placeholder { color: var(--muted); opacity: .9; }

/* Абоненты */
.kb-customer-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); text-decoration: none; }
.kb-customer-name > span:last-child { display: grid; gap: 1px; min-width: 0; }
.kb-customer-name b { font-weight: 650; overflow-wrap: break-word; }
.kb-customer-name small { color: var(--muted); font-size: 11px; }
.kb-customer-name .avatar { flex: 0 0 auto; width: 28px; height: 28px; font-size: 10px; }
.kb-customer-table td[data-label="Баланс"] { font-weight: 700; white-space: nowrap; }
.kb-customer-table td[data-label="Действия"] { width: 1%; }
.kb-pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; flex-wrap: wrap; font-size: 12px; }

/* Аудит */
.kb-audit-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.kb-audit-filters .filter-search { flex: 1 1 240px; min-width: 0; }
.kb-audit-filters select, .kb-audit-filters input { min-width: 0; flex: 0 1 170px; }
.audit-details summary { font-size: 11.5px; }
.audit-json pre { font-size: 10.5px; }
.audit-json > span { font-size: 10.5px; }

/* Сеть */
.kb-network-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 10px; align-items: start; }
.kb-router-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.kb-router-row:last-child { border-bottom: 0; }
.kb-router-row:hover { text-decoration: none; color: var(--accent); }
.kb-router-row .kb-row-main b { font-size: 12.5px; }
.kb-router-row .kb-row-main small { font-size: 11px; }
.kb-router-row .badge { flex: 0 0 auto; }
.kb-stale { color: var(--warn); font-size: 10.5px; }
.kb-wg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.kb-wg-item { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.kb-wg-item span { display: block; color: var(--muted); font-size: 10.5px; }
.kb-wg-item b { display: block; margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.kb-wg-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }

/* Мастер / формы */
.kb-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 10px 0 12px; }
.kb-step { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.kb-step b { display: block; font-size: 11.5px; }
.kb-step small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.kb-step.is-current { border-color: var(--accent); background: var(--accent-soft); }
.kb-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.kb-form-grid .form-field { min-width: 0; }
.kb-form-grid .form-field.is-wide { grid-column: 1 / -1; }
.kb-form-section { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-bottom: 8px; }
.kb-form-section legend { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--text); }
.kb-check-summary { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12px; }
.kb-check-summary b { font-size: 12.5px; }

/* Система */
.kb-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kb-setting { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.kb-setting span { display: block; color: var(--muted); font-size: 10.5px; }
.kb-setting b { display: block; margin-top: 2px; font-size: 12px; overflow-wrap: break-word; }
.kb-danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* Мобильная версия */
@media (max-width: 1180px) {
  .kb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kb-grid, .kb-network-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .kb-form-grid, .kb-settings-grid, .kb-wg-grid { grid-template-columns: 1fr; }
  .kb-form-grid .form-field.is-wide { grid-column: auto; }
}
@media (max-width: 820px) {
  .wrap { padding: 10px 10px 22px; }
  .app-main .topbar { height: 52px; padding: 6px 10px; }
  .sidebar { width: min(84vw, 290px); padding: 14px 10px; }
  .card { padding: 10px; border-radius: 10px; }
  .page-head, .workspace-head { display: grid; gap: 8px; padding: 10px 11px; }
  .page-head h1, .workspace-head h1 { font-size: 21px; }
  .page-actions, .head-actions { width: 100%; }
  .page-actions .btn, .page-actions button, .head-actions .btn, .head-actions button { flex: 1 1 auto; }
  .kb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .kb-kpi { padding: 8px 9px; }
  .kb-kpi > b { font-size: 18px; }
  .kb-kpi > span, .kb-kpi > small { font-size: 10.5px; }
  .kb-customer-name .avatar { display: none; }
  .kb-customer-table td[data-label="Баланс"] { white-space: normal; }
  .kb-grid-2 { grid-template-columns: 1fr; }
  .kb-searchbar { display: grid; grid-template-columns: 1fr; }
  .kb-searchbar select, .kb-searchbar button, .kb-searchbar .btn { width: 100%; }
  .kb-chips { flex-wrap: wrap; overflow: visible; }
  .kb-chip { flex: 0 0 auto; min-height: 34px; }
  .kb-audit-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .kb-audit-filters .filter-search { grid-column: 1 / -1; }
  .kb-audit-filters button, .kb-audit-filters .btn { grid-column: 1 / -1; }
  .responsive-table { min-width: 0 !important; display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; margin-bottom: 6px; background: var(--panel); }
  .responsive-table td { display: grid; grid-template-columns: minmax(82px, 34%) minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 4px 0; border: 0; text-align: left; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: 10.5px; font-weight: 650; text-align: left; }
  .responsive-table td[data-label="Действия"] { display: block; }
  .responsive-table td[data-label="Действия"]::before { display: block; margin-bottom: 4px; }
  .responsive-table td[data-label="Действия"] .row { display: flex; flex-wrap: wrap; }
  .responsive-table td[colspan] { display: block; text-align: center; }
  .responsive-table td[colspan]::before { display: none; }
  .table-actions { width: 100%; }
  .table-actions .btn, .table-actions button { flex: 1 1 auto; min-height: 30px; }
  .kb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-step:last-child { grid-column: 1 / -1; }
  .kb-row-value { font-size: 11.5px; }
  .nowrap { white-space: normal; }
}
@media (max-width: 430px) {
  .wrap { padding: 8px 8px 20px; }
  .kb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-kpi > b { font-size: 17px; }
  .card { padding: 9px; }
  .page-head h1, .workspace-head h1 { font-size: 20px; }
  .btn, button { font-size: 13px; }
  .responsive-table td { grid-template-columns: 1fr; gap: 1px; }
  .responsive-table td::before { margin-bottom: 1px; }
  .kb-row { align-items: flex-start; }
  .kb-row-value { white-space: normal; text-align: right; }
  .kb-steps { grid-template-columns: 1fr; }
  .kb-step:last-child { grid-column: auto; }
}
@media (max-width: 360px) {
  .kb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-kpi { padding: 8px; }
  .kb-kpi > b { font-size: 16px; }
}

/* Топология сети */
.kb-topology { display: grid; gap: 0; }
.kb-topology-connector { width: 1px; height: 12px; margin-left: 18px; background: var(--line-strong); }
.kb-node {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text); text-decoration: none;
}
.kb-node:hover { text-decoration: none; border-color: var(--accent); }
.kb-node-server { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.kb-node-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.kb-node-dot.good { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.kb-node-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.kb-node > span:nth-child(2), .kb-node-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.kb-node b { font-size: 12.5px; overflow-wrap: break-word; }
.kb-node small { color: var(--muted); font-size: 10.5px; overflow-wrap: break-word; }
.kb-node > .badge { flex: 0 0 auto; font-size: 10.5px; }
.kb-site-block { margin-top: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.kb-site-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.kb-site-head b { font-size: 12.5px; }
.kb-site-routers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 6px; }
.kb-site-routers .kb-node { min-height: 54px; }
.kb-badge-inline { color: var(--muted); font-size: 11px; }
.kb-subhead { margin: 6px 0; font-size: 12px; color: var(--text); }
.kb-accordion { padding: 0; }
.kb-accordion > summary { padding: 10px 12px; font-size: 12.5px; font-weight: 650; color: var(--text); }
.kb-accordion[open] > summary { border-bottom: 1px solid var(--line); }
.kb-accordion > :not(summary) { margin-left: 12px; margin-right: 12px; }
.notice-success { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: var(--good-soft); color: var(--good); }
.notice-success b { color: var(--good); }
@media (max-width: 820px) {
  .kb-site-block { padding: 7px; }
  .kb-site-routers { grid-template-columns: 1fr; }
  .kb-node { min-height: 48px; }
  .kb-node > .badge { font-size: 10px; }
  .kb-accordion > :not(summary) { margin-left: 9px; margin-right: 9px; }
}

/* Никаких принудительных пробелов между буквами в подписях */
.brand-copy small, .portal-brand small, .auth-brand small, .hero-eyebrow,
.blocked-eyebrow, .brand-tag, .blocked-meta span, .blocked-reason span,
.workspace-eyebrow, .eyebrow, .nav-group, .filter-field, th {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.side-brand, .side-nav a, .topbar-title, .badge, .btn, button, .kb-row-main b, .kb-customer-name b {
  word-break: normal;
  overflow-wrap: break-word;
}

.customer-balance .label, .stat span, .service-fact > span, .promise-summary span,
.traffic-summary span, .power-card .power-source, .stub-toolbar {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.kb-server-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.kb-server-row .kb-meter { grid-column: auto; height: 5px; }

@media (max-width: 820px) {
  .app-main { margin-left: 0; }
  .sidebar { width: min(84vw, 290px); }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 820px) {
  .responsive-table td[data-label="Действия"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    text-align: left;
  }
  .responsive-table td[data-label="Действия"]::before {
    display: block;
    width: auto;
    margin-bottom: 4px;
  }
  .responsive-table td[data-label="Действия"] .table-actions { width: 100%; }
}

/* ============================================================
   KENI-BILL 2026.11 — единый компактный слой
   ============================================================ */
html[data-theme="light"] body.staff-noc,
html[data-theme="light"] body.portal-noc {
  color-scheme: light;
  --bg: #f5f7fa;
  --bg-soft: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #152238;
  --muted: #617089;
  --line: #dbe3ec;
  --line-strong: #b9c6d6;
  --accent: #1f5eff;
  --accent-2: #0f766e;
  --accent-3: #7c3aed;
  --accent-soft: #e5edff;
  --good: #087f5b;
  --good-soft: #e6f7f0;
  --warn: #a15c00;
  --warn-soft: #fff4df;
  --bad: #b4233b;
  --bad-soft: #ffeaee;
  --shadow: 0 1px 2px rgba(18, 35, 58, .04), 0 4px 12px rgba(18, 35, 58, .04);
  --shadow-lift: 0 6px 18px rgba(18, 35, 58, .08);
}
html[data-theme="dark"] body.staff-noc,
html[data-theme="dark"] body.portal-noc {
  color-scheme: dark;
  --bg: #0d1420;
  --bg-soft: #121c2b;
  --panel: #162233;
  --panel-2: #1a293c;
  --text: #e9f0f8;
  --muted: #9babc0;
  --line: #293b52;
  --line-strong: #3a516d;
  --accent: #6ea0ff;
  --accent-2: #43c7b8;
  --accent-3: #b799ff;
  --accent-soft: #172d52;
  --good: #5ed6a6;
  --good-soft: #12372d;
  --warn: #f3bd5f;
  --warn-soft: #3b2d15;
  --bad: #ff8094;
  --bad-soft: #421923;
  --shadow: 0 1px 2px rgba(0,0,0,.22), 0 8px 20px rgba(0,0,0,.12);
  --shadow-lift: 0 10px 26px rgba(0,0,0,.24);
}

body.staff-noc, body.portal-noc, body.staff-login {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  background: var(--bg);
}
body.staff-noc .card, body.portal-noc .card, body.staff-login .card {
  border-radius: 10px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body.staff-noc .card:hover, body.portal-noc .card:hover { transform: none; box-shadow: var(--shadow); }
body.staff-noc .card + .card, body.portal-noc .card + .card { margin-top: 10px; }
body.staff-noc h1, body.portal-noc h1, body.staff-login h1 { font-size: 25px; line-height: 1.15; letter-spacing: -.015em; }
body.staff-noc h2, body.portal-noc h2 { font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
body.staff-noc h3, body.portal-noc h3 { font-size: 14px; line-height: 1.3; }
body.staff-noc .card h2, body.portal-noc .card h2 { font-size: 16px; margin-bottom: 7px; }
body.staff-noc .card h3, body.portal-noc .card h3 { font-size: 14px; }
body.staff-noc .small, body.portal-noc .small, body.staff-noc .help, body.portal-noc .help { font-size: 12px; }
body.staff-noc .muted, body.portal-noc .muted { color: var(--muted); }
body.staff-noc .page-head, body.staff-noc .workspace-head { padding: 11px 13px; margin-bottom: 9px; border-radius: 9px; }
body.staff-noc .page-head h1, body.staff-noc .workspace-head h1 { font-size: 24px; }
body.staff-noc .eyebrow, body.staff-noc .workspace-eyebrow { font-size: 11px; color: var(--muted); font-weight: 600; }
body.staff-noc .workspace-meta, body.staff-noc .page-head p { font-size: 12px; }
body.staff-noc .btn, body.staff-noc button, body.portal-noc .btn, body.portal-noc button {
  min-height: 34px; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600;
}
body.staff-noc .btn.small, body.staff-noc button.small, body.portal-noc .btn.small { min-height: 27px; padding: 2px 7px; font-size: 11.5px; }
body.staff-noc input, body.staff-noc select, body.staff-noc textarea,
body.portal-noc input, body.portal-noc select, body.portal-noc textarea { min-height: 34px; padding: 6px 8px; font-size: 13px; border-radius: 7px; }
body.staff-noc label, body.portal-noc label { font-size: 12px; }
body.staff-noc table, body.portal-noc table { font-size: 12.5px; }
body.staff-noc th, body.portal-noc th { font-size: 11px; padding: 6px 7px; letter-spacing: 0; text-transform: none; }
body.staff-noc td, body.portal-noc td { padding: 6px 7px; }
body.staff-noc .compact-table th, body.staff-noc .compact-table td { padding: 5px 7px; }
body.staff-noc .badge, body.portal-noc .badge { font-size: 10.5px; padding: 1px 6px; letter-spacing: 0; white-space: normal; }
body.staff-noc .responsive-table td::before { font-size: 10.5px; letter-spacing: 0; text-transform: none; }

/* Компактные строки и таблицы */
.kb-row { padding: 6px 0; }
.kb-row-main b { font-size: 12.5px; }
.kb-row-main small { font-size: 10.5px; }
.kb-kpis { gap: 7px; margin-bottom: 8px; }
.kb-kpi { padding: 9px 10px; border-radius: 8px; }
.kb-kpi > span { font-size: 10.5px; }
.kb-kpi > b { font-size: 19px; }
.kb-kpi > small { font-size: 10px; }
.kb-grid, .kb-grid-2 { gap: 8px; }
.kb-stack { gap: 8px; }
.kb-searchbar { gap: 5px; margin-bottom: 7px; }
.kb-searchbar input { min-height: 34px; }
.kb-chips { gap: 4px; margin-bottom: 7px; }
.kb-chip { padding: 3px 8px; font-size: 11.5px; }
.kb-section-title { margin-bottom: 5px; }
.kb-section-title h2 { font-size: 15px; }
.kb-section-title a { font-size: 11px; }
.kb-settings-grid { gap: 5px; }
.kb-setting { padding: 6px 7px; border-radius: 6px; }
.kb-setting span { font-size: 10px; }
.kb-setting b { font-size: 11.5px; }
.kb-empty { padding: 9px 0; font-size: 11.5px; }
.kb-server-inline { display: grid; grid-template-columns: 38px minmax(0,1fr) 38px minmax(0,1fr) 38px minmax(0,1fr); gap: 4px 6px; align-items: center; margin-top: 7px; color: var(--muted); font-size: 10.5px; }
.kb-server-inline .kb-meter { height: 4px; }
.kb-inline-check { display: inline-flex; align-items: center; gap: 5px; margin: 0; white-space: nowrap; font-size: 11.5px; }
.kb-inline-check input { width: auto; min-height: 0; }

/* Меню действий в строке */
.row-menu { position: relative; display: inline-block; margin: 0; padding: 0; border: 0; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-panel { position: absolute; right: 0; top: calc(100% + 5px); z-index: 30; min-width: 180px; display: none; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 10px 28px rgba(15,23,42,.16); }
.row-menu[open] .row-menu-panel { display: grid; gap: 2px; }
.row-menu-panel .btn { width: 100%; justify-content: flex-start; text-align: left; }
.row-details { margin: 4px 0 0; padding: 0; border: 0; }
.row-details > summary { font-size: 10.5px; color: var(--accent); }
.row-details .kb-list { margin-top: 4px; }

/* Табы */
.ui-tabs { display: flex; gap: 3px; overflow-x: auto; padding: 3px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tabs button { flex: 0 0 auto; min-height: 29px; padding: 4px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ui-tabs button:hover { color: var(--text); background: var(--bg-soft); box-shadow: none; transform: none; }
.ui-tabs button.is-active { color: var(--accent); background: var(--accent-soft); }
.ui-tab-panel[hidden] { display: none !important; }
.kb-node-wg { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.kb-node-wg .kb-node-dot { background: var(--accent); }

@media (max-width: 820px) {
  body.staff-noc h1, body.portal-noc h1 { font-size: 22px; }
  body.staff-noc .page-head h1, body.staff-noc .workspace-head h1 { font-size: 21px; }
  body.staff-noc .card { padding: 9px; }
  body.staff-noc .page-head, body.staff-noc .workspace-head { padding: 9px 10px; }
  body.staff-noc .btn, body.staff-noc button { min-height: 34px; }
  body.staff-noc .btn.small, body.staff-noc button.small { min-height: 28px; }
  body.staff-noc input, body.staff-noc select { min-height: 36px; }
  body.staff-noc .responsive-table tr { padding: 6px 8px; }
  body.staff-noc .responsive-table td { grid-template-columns: minmax(76px, 34%) minmax(0,1fr); padding: 3px 0; }
  body.staff-noc .responsive-table td[data-label="Действия"] { display: grid !important; grid-template-columns: 1fr !important; width: 100%; }
  body.staff-noc .responsive-table td[data-label="Действия"]::before { display: block; width: auto; margin-bottom: 3px; }
  body.staff-noc .responsive-table td[colspan] { display: block; }
  body.staff-noc .responsive-table td[colspan]::before { display: none; }
  body.staff-noc .table-actions { width: 100%; }
  body.staff-noc .table-actions .btn, body.staff-noc .table-actions button { flex: 1 1 auto; min-height: 30px; }
  .ui-tabs { margin-left: -2px; margin-right: -2px; }
  .ui-tabs button { min-height: 32px; }
  .kb-server-inline { grid-template-columns: 34px minmax(0,1fr); }
  .kb-server-inline > span:nth-of-type(2), .kb-server-inline > span:nth-of-type(3) { grid-column: auto; }
  .kb-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kb-kpi > b { font-size: 17px; }
  .kb-searchbar { display: grid; grid-template-columns: 1fr; }
  .kb-searchbar select, .kb-searchbar button, .kb-searchbar .btn { width: 100%; }
}
@media (max-width: 430px) {
  .kb-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kb-kpi { padding: 7px 8px; }
  .kb-kpi > span, .kb-kpi > small { font-size: 9.5px; }
  .responsive-table td { grid-template-columns: 1fr; }
  .responsive-table td::before { margin-bottom: 1px; }
  .row-menu-panel { right: auto; left: 0; }
}

/* Компактные мобильные строки вместо длинных карточек */
@media (max-width: 820px) {
  .compact-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1px 10px;
    padding: 6px 8px;
  }
  .compact-table td {
    display: block;
    width: auto;
    padding: 1px 0;
    text-align: left;
    border: 0;
    min-width: 0;
  }
  .compact-table td::before {
    display: inline;
    margin-right: 4px;
    font-size: 9.5px;
    vertical-align: baseline;
  }
  .compact-table td[data-label="Абонент"],
  .compact-table td[data-label="Позиция"],
  .compact-table td[data-label="Событие"],
  .compact-table td[data-label="Название"],
  .compact-table td[data-label="Роутер"],
  .compact-table td[data-label="Время"],
  .compact-table td[data-label="Объект"],
  .compact-table td[data-label="Сообщение"],
  .compact-table td[data-label="Ошибка"],
  .compact-table td[data-label="Действия"] {
    grid-column: 1 / -1;
  }
  .compact-table td[data-label="Действия"] { display: block !important; padding-top: 3px; }
  .compact-table td[data-label="Действия"]::before { display: block; margin-bottom: 2px; }
  .compact-table td[data-label="Статус"] { text-align: right; }
  .compact-table td[data-label="Статус"]::before { display: none; }
  .compact-table .kb-row-value { white-space: normal; }
  .compact-table td.is-empty { display: none !important; }
  .ui-tabs { flex-wrap: wrap; overflow-x: visible; }
  .ui-tabs button { flex: 0 0 auto; }
  .filter-search input { padding-left: 35px; }
}
@media (max-width: 430px) {
  .compact-table tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .compact-table td { grid-template-columns: none; }
  .compact-table td[data-label="Действия"] { grid-column: 1 / -1; }
}

/* Светлая тема входа и аккуратная тёмная тема */
html[data-theme="light"] body.staff-login {
  color-scheme: light;
  --bg: #f5f7fa; --bg-soft: #eef2f6; --panel: #ffffff; --panel-2: #f7f9fc;
  --text: #152238; --muted: #617089; --line: #dbe3ec; --line-strong: #b9c6d6;
  --accent: #1f5eff; --accent-2: #0f766e; --accent-3: #7c3aed; --accent-soft: #e5edff;
  --good: #087f5b; --good-soft: #e6f7f0; --warn: #a15c00; --warn-soft: #fff4df;
  --bad: #b4233b; --bad-soft: #ffeaee;
  --shadow: 0 1px 2px rgba(18,35,58,.04), 0 8px 24px rgba(18,35,58,.06);
  background: var(--bg); color: var(--text);
}
html[data-theme="light"] body.staff-login .login {
  background: var(--panel); border-color: var(--line); color: var(--text);
  box-shadow: 0 18px 50px rgba(18,35,58,.10);
}
html[data-theme="light"] body.staff-login .login h1 { color: var(--text); }
html[data-theme="light"] body.staff-login .login .muted,
html[data-theme="light"] body.staff-login .login label { color: var(--muted); }
html[data-theme="light"] body.staff-login .login input { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
html[data-theme="light"] body.staff-login .login a { color: var(--accent); }
html[data-theme="light"] body.staff-login .auth-brand b { color: var(--text); }
html[data-theme="light"] body.staff-login .auth-brand small { color: var(--muted); }

html[data-theme="dark"] body.staff-noc .sidebar {
  background: #101a2a;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(0,0,0,.18);
}
html[data-theme="dark"] body.staff-noc .topbar { background: color-mix(in srgb, var(--panel) 92%, transparent); }
html[data-theme="dark"] body.staff-noc .side-nav a:hover { background: var(--panel-2); }
html[data-theme="dark"] body.staff-noc .side-nav a.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
html[data-theme="dark"] body.staff-noc .side-brand,
html[data-theme="dark"] body.staff-noc .brand-copy b { color: var(--text); }
html[data-theme="dark"] body.staff-noc .brand-copy small,
html[data-theme="dark"] body.staff-noc .side-user small { color: var(--muted); }
html[data-theme="dark"] body.staff-noc .side-user b { color: var(--text); }
html[data-theme="dark"] body.staff-noc .sidebar .avatar { background: var(--accent-soft); color: var(--accent); }

/* Поля с иконкой поиска не должны перекрываться глобальным padding */
body.staff-noc .filter-search input,
body.portal-noc .filter-search input,
.filter-search input { padding-left: 40px !important; }
body.staff-noc .top-search input,
body.portal-noc .top-search input,
.top-search input { padding-left: 40px !important; padding-right: 74px !important; }
.audit-table td[data-label="Действие"] { overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .customer-tabs { flex-wrap: wrap; overflow-x: visible; }
  .customer-tabs button { white-space: normal; }
}

/* Технические значения в таблицах */
.ip-pool-range, td[data-label="Диапазон"], td[data-label="Шлюз"] { white-space: nowrap; }
@media (max-width: 820px) {
  .ip-pool-range, td[data-label="Диапазон"], td[data-label="Шлюз"] { white-space: normal; overflow-wrap: anywhere; }
}
