:root {
  --bg: #090909;
  --surface: #171717;
  --surface-elevated: #1d1d1d;
  --surface-soft: #1d1d1d;
  --border: #2f2f2f;
  --border-strong: #4a4a4a;
  --text: #f4f4f4;
  --muted: #a7a29b;
  --accent: #ff8a1f;
  --danger: #ff6b6b;
  --ok: #67c89c;
  --motion-fast: 150ms;
  --motion-normal: 220ms;
  --motion-slow: 320ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Только opacity: transform на предке ломает position:fixed у модалок внутри main.page-content */
@keyframes page-content-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-backdrop-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-window-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes auth-page-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-logo-float {
  from,
  to {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 138, 31, 0.18), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(255, 138, 31, 0.1), transparent 24%),
    var(--bg);
}

body {
  min-height: 100vh;
}

/* Стартовый экран: до готовности React футер не показываем, поверх — брендированный лоадер */
body.app-booting {
  overflow: hidden;
}

body.app-booting .site-footer {
  visibility: hidden;
  position: fixed;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

body:not(.app-booting) .app-boot-screen {
  display: none;
}

.app-boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 138, 31, 0.2), rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 90% 6%, rgba(255, 107, 107, 0.1), rgba(0, 0, 0, 0) 32%),
    var(--bg);
}

.app-boot-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px;
  animation: app-boot-fade-in 0.45s var(--ease-out) both;
}

@keyframes app-boot-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-boot-brand {
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 8px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.app-boot-product {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  text-shadow: 0 0 32px color-mix(in srgb, var(--accent) 30%, transparent);
}

.app-boot-product-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.app-boot-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.app-boot-spinner {
  width: 100%;
  height: 100%;
  border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-top-color: var(--accent);
  border-right-color: color-mix(in srgb, var(--danger) 50%, var(--accent));
  border-radius: 50%;
  box-sizing: border-box;
  animation: app-boot-spin 0.88s linear infinite;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 35%, transparent));
}

@keyframes app-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-screen-inner {
    animation: none;
  }
  .app-boot-spinner {
    animation-duration: 1.4s;
    animation-timing-function: var(--ease-soft, ease);
  }
}

.app-boot-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;
}

.site-footer {
  margin-top: auto;
  padding: 20px 16px 28px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, #000);
}

.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 8px;
}

.site-footer-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.site-footer-line a {
  color: #ffbf8a;
  text-decoration: none;
}

.site-footer-line a:hover {
  text-decoration: underline;
}

.site-footer-sep {
  color: var(--border-strong);
}

.site-footer-credit {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.site-footer-credit a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-credit a:hover {
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.glass {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background-color var(--motion-normal) var(--ease-soft),
    box-shadow var(--motion-normal) var(--ease-soft),
    transform var(--motion-normal) var(--ease-out);
}

.card {
  padding: 18px;
  margin-bottom: 14px;
}

.card.glass:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
}

.app-shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px;
}

.app-shell-new {
  display: grid;
  gap: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 138, 31, 0.1), rgba(255, 255, 255, 0)), var(--surface);
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background var(--motion-normal) var(--ease-soft),
    box-shadow var(--motion-normal) var(--ease-soft);
}

.topbar:hover {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
}

.topbar-userline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.context-pill {
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #121212;
}

.context-pill strong {
  font-size: 0.76rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.product-beta-badge {
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  line-height: 1.1;
  color: color-mix(in srgb, var(--accent) 80%, #fff);
  padding: 0;
  border: none;
  background: none;
}

.product-beta-badge-logo {
  position: absolute;
  right: -2px;
  bottom: -9px;
}

.product-beta-badge--auth {
  margin: 0 auto 14px;
  font-size: 0.68rem;
  padding: 5px 11px 4px;
  letter-spacing: 0.16em;
}

.brand img {
  width: auto;
  height: 34px;
  max-width: 140px;
  border-radius: 0;
  object-fit: contain;
  object-position: left center;
  border: none;
  background: transparent;
}

.brand h1 {
  margin: 0;
  font-size: 1.02rem;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
}

.side-nav {
  height: fit-content;
  position: sticky;
  top: 14px;
  padding: 14px;
}

.side-nav-items {
  display: grid;
  gap: 12px;
}

.side-nav-group {
  display: grid;
  gap: 8px;
}

.side-nav-group-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-nav-group-items {
  display: grid;
  gap: 8px;
}

.nav-btn {
  text-decoration: none;
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background var(--motion-fast) var(--ease-soft),
    color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft),
    transform var(--motion-fast) var(--ease-out);
}

.nav-btn:hover {
  border-color: var(--border-strong);
  background: #1a1a1a;
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn.ghost {
  color: var(--muted);
}

.nav-btn.side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 6px;
}

.nav-btn.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.page-content {
  min-width: 0;
  animation: page-content-in var(--motion-slow) var(--ease-out) both;
}

.page-header {
  margin-bottom: 12px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.page-header p {
  margin: 6px 0 0;
}

.section-card {
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-head h2 {
  margin: 0;
  font-size: 1.02rem;
}

.section-head p {
  margin: 6px 0 0;
}

.section-body {
  margin-top: 12px;
}

.status-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.scope-switcher {
  position: relative;
}

.scope-switcher-trigger {
  display: grid;
  gap: 2px;
  min-width: 250px;
  text-align: left;
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.scope-switcher-trigger-label {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scope-switcher-trigger strong {
  font-size: 0.8rem;
  line-height: 1.25;
}

.scope-switcher-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 25;
  width: min(420px, 92vw);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, #121212);
  color: #ffd9b8;
  font-size: 0.72rem;
  font-weight: 700;
}

.topbar-user-name {
  font-size: 0.82rem;
  color: var(--muted);
}

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.status-line.error {
  color: var(--danger);
}

.field-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.controls {
  margin-bottom: 0;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 12px;
  width: min(620px, 100%);
}

.controls-grid.compact {
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px);
  width: auto;
  gap: 8px;
}

.controls-grid.compact .control-field {
  gap: 0;
}

.controls-grid.compact select {
  min-height: 34px;
  font-size: 0.78rem;
  border-radius: 9px;
}

.control-field {
  display: grid;
  gap: 6px;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background-color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft);
}

textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
  font-family: "Consolas", monospace;
  font-size: 12px;
}

.command-box {
  min-height: 92px;
}

input::placeholder {
  color: #999188;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.button {
  border: 1px solid #6e4628;
  border-radius: 12px;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 42%, transparent),
    color-mix(in srgb, var(--accent) 20%, transparent)
  );
  color: #ffd5b5;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background var(--motion-fast) var(--ease-soft),
    color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft),
    transform var(--motion-fast) var(--ease-out);
}

.button:hover {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.button.ghost {
  background: #1a1a1a;
  border: 1px solid #454545;
  color: var(--text);
}

.button.ghost:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.button.ghost.active {
  border-color: #8b5a36;
  color: #ffd7b3;
  background: rgba(255, 138, 31, 0.12);
}

.button.small {
  padding: 6px 9px;
  font-size: 0.74rem;
}

.button.ghost.danger {
  border-color: rgba(255, 119, 119, 0.45);
  color: #ffb4b4;
}

.create-tag-row {
  display: flex;
  gap: 8px;
}

.create-tag-row.wrap {
  flex-wrap: wrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.keys-tags-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.keys-tags-lead {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #b8b0a6;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.profile-page {
  max-width: 880px;
}

.profile-grid {
  display: grid;
  gap: 18px;
}

.profile-field-block {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.profile-inline-actions .button {
  flex: 0 0 auto;
}

.profile-input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 420px;
}

.profile-dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.profile-dl > div {
  display: grid;
  gap: 4px;
}

.profile-dl dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.profile-dl dd {
  margin: 0;
  font-size: 0.92rem;
}

.profile-2fa-status {
  margin: 0 0 14px;
  font-size: 0.88rem;
}

.profile-2fa-on {
  color: var(--ok);
  font-weight: 700;
}

.profile-2fa-off {
  color: var(--muted);
  font-weight: 600;
}

.profile-2fa-flow {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.profile-2fa-setup {
  display: grid;
  gap: 10px;
}

.profile-2fa-primary {
  width: fit-content;
  max-width: 100%;
}

.profile-msg {
  margin-top: 8px;
}

.server-name-edit-block {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.server-name-input {
  width: 100%;
  max-width: 280px;
  font-size: 0.9rem;
}

.server-name-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-name-stack {
  display: grid;
  gap: 3px;
  justify-items: start;
  margin-bottom: 2px;
}

.server-name-btn-subtle {
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.85;
}

.modal-confirm-text p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.88rem;
}

.modal-prompt-msg {
  margin: 0 0 10px;
}

.modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-actions-row .button {
  flex: 0 0 auto;
}

.button.danger {
  background: rgba(255, 107, 107, 0.18);
  border: 1px solid rgba(255, 107, 107, 0.55);
  color: #ffd6d6;
}

.button.danger:hover {
  background: rgba(255, 107, 107, 0.28);
}

.keys-tags-stack {
  display: grid;
  gap: 18px;
}

.keys-tags-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.keys-tags-actions input {
  flex: 1 1 220px;
  min-width: 0;
}

.keys-tags-highlight {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 138, 31, 0.35);
  background: rgba(255, 138, 31, 0.08);
}

.keys-tags-secret {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  word-break: break-all;
  color: #ffe8cf;
}

.keys-tags-block {
  display: grid;
  gap: 8px;
}

.keys-tags-command-head-spaced {
  margin-top: 12px;
  margin-bottom: 6px;
}

.keys-tags-command-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.keys-tags-command-head .field-label {
  margin: 0;
}

.keys-tags-list {
  display: grid;
  gap: 10px;
}

.keys-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #141414;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background-color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft);
}

.keys-tags-row:hover {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
  background: #181818;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.keys-tags-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.keys-tags-row-title {
  font-weight: 600;
  font-size: 0.88rem;
}

.settings-tag-list {
  display: grid;
  gap: 8px;
}

.settings-tag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.org-compact-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.org-compact-list-spaced {
  margin-top: 14px;
}

.org-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #3b3b3b;
  border-radius: 11px;
  background: #171717;
  padding: 10px 12px;
}

.org-chip-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.org-chip.active {
  border-color: rgba(255, 138, 31, 0.55);
  background: rgba(255, 138, 31, 0.09);
}

.org-chip-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.org-chip-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-filters {
  margin-bottom: 8px;
}

.dashboard-table {
  margin-top: 10px;
}

.dashboard-filters .controls-grid {
  width: 100%;
}

.stat-card {
  margin-bottom: 0;
  display: grid;
  gap: 6px;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background-color var(--motion-fast) var(--ease-soft),
    transform var(--motion-fast) var(--ease-out);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  font-size: 1.4rem;
}

.metric-row {
  margin: 0 0 8px;
  font-size: 0.875rem;
}

.metric-row:last-child {
  margin-bottom: 0;
}

.table-shell {
  padding: 0;
  overflow: hidden;
}

.table-header-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #1c1c1c;
}

.table-header-row p {
  margin: 0;
}

.server-table {
  width: 100%;
  border-collapse: collapse;
}

.server-table thead th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: #1c1c1c;
}

.server-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.01);
}

.server-table tbody tr {
  transition:
    background-color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft);
}

.server-table tbody tr:hover {
  background-color: color-mix(in srgb, var(--accent) 7%, rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.server-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.server-name-btn {
  border: none;
  background: transparent;
  color: #ffd7b3;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.server-name-btn:hover {
  text-decoration: underline;
}

.server-rename-link {
  display: block;
  margin: 1px 0 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
}

.server-rename-link:hover {
  color: var(--accent);
}

.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.server-actions-dropdown {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.server-actions-trigger {
  width: auto;
  min-width: 0;
}

.server-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 188px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.server-actions-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-soft);
}

.server-actions-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.server-actions-menu-item-danger {
  color: var(--danger);
}

.server-actions-menu-item-danger:hover {
  background: rgba(255, 107, 107, 0.08);
}

.server-summary-gap {
  margin-bottom: 8px;
}

.server-details-row td {
  background: rgba(255, 138, 31, 0.07);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-card {
  border: 1px solid #3a3a3a;
  background: #141414;
  border-radius: 10px;
  padding: 10px;
}

.detail-card h4 {
  margin: 0 0 8px;
}

.detail-card p {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.detail-card p:last-child {
  margin-bottom: 0;
}

.history-toolbar {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.history-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-custom-range {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.history-custom-range label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.history-custom-range input[type="datetime-local"] {
  min-height: 40px;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text);
  background: #141414;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color-scheme: dark;
}

.history-custom-range input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  filter: invert(0.92);
}

.history-charts-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.tiny-chart {
  display: grid;
  gap: 6px;
  position: relative;
}

.tiny-chart-with-axes svg {
  min-height: 200px;
}

.tiny-chart svg {
  width: 100%;
  height: auto;
  min-height: 140px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid #3a3a3a;
}

.tiny-chart-line polyline,
.chart-series-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-axis-line {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.chart-axis-tick {
  fill: var(--muted);
  font-size: 9px;
}

.chart-axis-tick-x {
  font-size: 8px;
}

.chart-axis-label {
  fill: #9a9288;
  font-size: 10px;
}

.tiny-chart-svg.accent .chart-series-line {
  stroke: #ff8a1f;
}

.tiny-chart-svg.ok .chart-series-line {
  stroke: #67c89c;
}

.tiny-chart-svg.warn .chart-series-line {
  stroke: #ffc266;
}

.tiny-chart-svg.muted .chart-series-line {
  stroke: #c6bdb3;
}

.tiny-chart-legend {
  margin: 0;
  font-size: 0.72rem;
  color: #b8b0a6;
  line-height: 1.35;
}

.tiny-chart-guide {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.tiny-chart-dot {
  fill: #f4f4f4;
  stroke: rgba(255, 138, 31, 0.85);
  stroke-width: 2;
}

.tiny-chart-line.accent polyline {
  stroke: #ff8a1f;
}

.tiny-chart-line.ok polyline {
  stroke: #67c89c;
}

.tiny-chart-line.warn polyline {
  stroke: #ffc266;
}

.tiny-chart-line.muted polyline {
  stroke: #c6bdb3;
}

.tiny-chart-svg .tiny-chart-dot {
  fill: #f4f4f4;
  stroke: rgba(255, 138, 31, 0.85);
  stroke-width: 2;
}

.tiny-chart-svg.ok .tiny-chart-dot {
  stroke: rgba(103, 200, 156, 0.9);
}

.tiny-chart-svg.warn .tiny-chart-dot {
  stroke: rgba(255, 194, 102, 0.95);
}

.tiny-chart-svg.muted .tiny-chart-dot {
  stroke: rgba(198, 189, 179, 0.9);
}

.tiny-chart-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
}

.tiny-chart-tooltip {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid #474747;
  background: rgba(9, 9, 9, 0.92);
}

.tiny-chart-tooltip span {
  font-size: 0.78rem;
  color: #ffe0c2;
  font-weight: 700;
}

.tiny-chart-tooltip small {
  color: #beb6ab;
  font-size: 0.68rem;
}

.tiny-chart.empty {
  border: 1px dashed #3a3a3a;
  border-radius: 8px;
  min-height: 86px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.tiny-chart-gap-note {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: #ffb38a;
  line-height: 1.35;
}

.dashboard-add-server-modal-lead {
  margin-top: 0;
  margin-bottom: 10px;
}

.dashboard-add-server-modal-actions {
  margin-top: 12px;
}

.dashboard-health-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.dashboard-health-item {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  display: grid;
  gap: 4px;
}

.dashboard-health-item:last-child {
  border-right: none;
}

.dashboard-health-item span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-health-item strong {
  font-size: 1rem;
}

.dashboard-action-bar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
}

.dashboard-action-main {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(200px, 1.2fr) minmax(140px, 0.95fr) minmax(120px, 0.85fr);
  flex: 1;
}

.dashboard-status-segment {
  display: flex;
  gap: 6px;
  align-items: end;
}

.dashboard-add-server-inline {
  min-width: 144px;
  align-self: stretch;
}

/* Не задавайте display:flex на <td> — ломается сетка колонок; стек — только внутри .server-cell-stack */
.server-load-cell,
.server-network-cell {
  text-align: left;
  font-size: 0.78rem;
  vertical-align: top;
}

.server-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.server-cell-stack-nowrap {
  white-space: nowrap;
}

.server-last-update-cell {
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
}

.detail-card-with-zoom {
  position: relative;
}

.detail-card-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-card-chart-title {
  margin: 0;
  font-size: 0.82rem;
}

.chart-zoom-trigger {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.chart-zoom-trigger:hover {
  color: var(--text);
  border-color: rgba(255, 138, 31, 0.45);
  background: rgba(255, 138, 31, 0.1);
}

.chart-zoom-icon {
  display: block;
}

.chart-zoom-modal-body {
  min-height: 200px;
}

.plan-pill {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.plan-pill.free {
  color: #c8c2bc;
}

.plan-pill.hero {
  background: linear-gradient(90deg, #ff4500, #ff8a1f, #ffd27a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 100, 40, 0.35);
}

.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  border: 1px solid var(--border);
  background: #121212;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}

.notif-bell-icon {
  font-size: 1.1rem;
}

.notif-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff4d4d;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 92vw);
  max-height: min(420px, 72vh);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 12px;
  z-index: 50;
  border-radius: 14px;
}

.notif-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.notif-push-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.tiny-notif-msg {
  margin: 0;
  font-size: 0.75rem;
}

.notif-list {
  display: grid;
  gap: 8px;
}

.notif-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(260px, 46vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-right: -2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 138, 31, 0.55) rgba(255, 255, 255, 0.06);
}

.notif-list-scroll::-webkit-scrollbar {
  width: 8px;
}

.notif-list-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.notif-list-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 138, 31, 0.75), rgba(255, 77, 0, 0.45));
  border-radius: 999px;
  border: 2px solid rgba(18, 18, 18, 0.85);
}

.notif-list-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 160, 70, 0.9), rgba(255, 100, 40, 0.6));
}

.notif-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #141414;
}

.notif-item.read {
  opacity: 0.65;
}

.notif-item strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.notif-item p {
  margin: 0 0 4px;
  font-size: 0.78rem;
}

.notif-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.notif-center-form {
  margin-top: 2px;
}

.notif-center-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #141414;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background var(--motion-fast) var(--ease-soft),
    transform var(--motion-fast) var(--ease-out);
}

.notif-center-check:hover {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  background: #181818;
  transform: translateY(-1px);
}

.notif-center-check span {
  color: var(--text);
  display: grid;
  gap: 2px;
}

.notif-center-check strong {
  font-size: 0.84rem;
}

.notif-center-check small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.notif-center-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.notif-email-digest-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notif-email-digest-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-digest-test-btn {
  white-space: nowrap;
}

.notif-center-check-grow {
  flex: 1;
  min-width: 0;
}

.notif-digest-gear-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--ease-soft),
    border-color var(--motion-fast) var(--ease-soft),
    background var(--motion-fast) var(--ease-soft);
}

.notif-digest-gear-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: rgba(255, 138, 31, 0.08);
}

.notif-digest-gear-icon {
  display: block;
}

.notif-capacity-hint {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.notif-capacity-hint-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.notif-capacity-hint-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.notif-capacity-hint-list li {
  margin-bottom: 8px;
}

.notif-capacity-hint-list li:last-child {
  margin-bottom: 0;
}

.notif-capacity-code {
  font-size: 0.78em;
  color: var(--text);
}

.notif-digest-modal-lead {
  margin-top: 0;
  line-height: 1.45;
}

.notif-digest-modal-hint {
  margin: 0 0 8px;
  font-size: 0.8rem;
}

.notif-center-wide {
  grid-column: 1 / -1;
}

.notif-center-wide textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  min-height: 96px;
}

.notif-center-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.notif-stale-table-wrap {
  display: grid;
  gap: 12px;
}

.notif-stale-table-wrap table {
  border-radius: 12px;
  overflow: hidden;
}

.notif-stale-table-wrap .server-table td input[type="number"] {
  width: 130px;
}

.notif-center-feed {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.notif-feed-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

.notif-feed-toolbar p {
  margin: 0;
}

.notif-feed-size {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.notif-pagination {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.notif-center-feed .notif-item {
  border-radius: 12px;
  padding: 10px 12px;
}

.notif-center-feed .notif-item strong {
  font-size: 0.85rem;
}

.notif-center-feed .notif-item small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.status-pill.online {
  color: #8fe2b4;
  border: 1px solid rgba(99, 216, 156, 0.42);
  background: rgba(99, 216, 156, 0.1);
}

.status-pill.stale {
  color: #ffd9b8;
  border: 1px solid rgba(255, 138, 31, 0.48);
  background: rgba(255, 138, 31, 0.16);
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 40px;
  position: relative;
  overflow-x: hidden;
}

.auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(255, 138, 31, 0.22), transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(255, 138, 31, 0.08), transparent 38%),
    radial-gradient(circle at 88% 70%, rgba(120, 160, 255, 0.06), transparent 32%);
  z-index: 0;
}

.auth-page {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
  animation: auth-page-in var(--motion-slow) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-page {
    animation: none;
  }
}

.auth-hero {
  text-align: center;
}

.auth-logo-wrap {
  position: relative;
  width: clamp(120px, 36vw, 152px);
  height: clamp(120px, 36vw, 152px);
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 36px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-logo-glow {
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 31, 0.42) 0%, transparent 68%);
  filter: blur(18px);
  opacity: 0.85;
  z-index: 0;
}

.auth-logo {
  position: relative;
  z-index: 1;
  width: clamp(72px, 22vw, 104px);
  height: clamp(72px, 22vw, 104px);
  object-fit: contain;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.5));
  animation: auth-logo-float 5s var(--ease-soft) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo {
    animation: none;
  }
}

.auth-product-name {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-lead {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

.auth-card {
  width: 100%;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.12)), var(--surface);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #0c0c0c;
  border: 1px solid var(--border);
}

.auth-tab {
  border: none;
  border-radius: 11px;
  padding: 11px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition:
    background var(--motion-fast) var(--ease-soft),
    color var(--motion-fast) var(--ease-soft),
    box-shadow var(--motion-fast) var(--ease-soft);
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: #fff3e8;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 38%, transparent), color-mix(in srgb, var(--accent) 14%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.25);
}

.auth-fields {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.auth-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.auth-field input {
  min-height: 46px;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.auth-cta {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  border-radius: 14px;
  margin-top: 2px;
}

.auth-error {
  margin: 0;
  text-align: center;
}

.auth-foot {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-captcha-field .auth-recaptcha {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 78px;
}

.auth-recaptcha-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.auth-text-btn {
  border: none;
  background: transparent;
  color: color-mix(in srgb, var(--accent) 92%, #fff);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 4px;
  text-align: center;
  width: 100%;
  font-family: inherit;
}

.auth-text-btn:hover {
  text-decoration: underline;
  color: var(--accent);
}

.auth-reset-hint {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-info {
  margin: 0;
  text-align: center;
  color: var(--ok);
  font-size: 0.86rem;
  line-height: 1.4;
}

.onboarding-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.onboarding-card {
  width: min(760px, 100%);
}

.stacked-form {
  display: grid;
  gap: 10px;
}

.totp-qr-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f7f4f0;
  width: fit-content;
}

.totp-qr-img {
  display: block;
  border-radius: 10px;
}

.totp-otpauth-fallback {
  margin-top: 6px;
}

.totp-otpauth-fallback summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  user-select: none;
}

.totp-otpauth-fallback[open] summary {
  margin-bottom: 8px;
}

.totp-qr-host canvas,
.totp-qr-host img {
  display: block;
  border-radius: 10px;
}

.org-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
}

.org-settings-column {
  display: grid;
  gap: 16px;
}

.project-card-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.project-settings-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #141414;
}

.project-rename-row {
  display: grid;
  gap: 8px;
}

.project-rename-main {
  display: grid;
  gap: 8px;
}

.project-rename-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.project-rename-controls input {
  flex: 1 1 200px;
  min-width: 0;
}

.project-rename-slug {
  font-size: 0.78rem;
}

.members-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.members-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #171717;
}

.members-list-email {
  font-size: 0.86rem;
  font-weight: 600;
}

.billing-terms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.billing-term-card {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #131313;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #ddd6cd;
}

.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.billing-plan-tile {
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.15));
}

.billing-plan-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.billing-plan-discount {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8fd9a8;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(143, 217, 168, 0.12);
}

.billing-plan-price {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.billing-plan-cta {
  margin-top: 4px;
}

.billing-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.billing-donate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.billing-donate-text {
  flex: 1 1 200px;
}

.billing-donate-subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted, rgba(255, 255, 255, 0.72));
}

.billing-donate-price {
  margin: 0;
}

.billing-donate-cta {
  margin-left: auto;
}

.small-print {
  font-size: 0.72rem;
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* Увеличенный график: портал в body, поверх шапки и выпадашек */
.modal-backdrop-chart {
  z-index: 10000;
}

.modal-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.62);
  animation: modal-backdrop-fade var(--motion-normal) var(--ease-soft) both;
}

.modal-window {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(82vh, 620px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: modal-window-in var(--motion-normal) var(--ease-out) both;
}

.modal-window-wide {
  width: min(980px, 96vw);
  max-width: 96vw;
  max-height: min(90vh, 920px);
}

.modal-window-wide .modal-body {
  max-height: calc(90vh - 120px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-body {
  padding: 16px;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.modal-close {
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 10px;
}

.small-gap {
  margin: 6px 0 0;
}

.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-chip-row-compact {
  margin-bottom: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 138, 31, 0.12);
  border: 1px solid rgba(255, 138, 31, 0.35);
  color: #ffe8d4;
  transition:
    border-color var(--motion-fast) var(--ease-soft),
    background-color var(--motion-fast) var(--ease-soft),
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-soft);
}

.tag-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(255, 138, 31, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.tag-chip-readonly {
  padding-right: 10px;
}

.tag-chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.85;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tag-picker-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.tag-picker-item {
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
  background: #1a1a1a;
  color: #f2f2f2;
  font-size: 0.86rem;
  cursor: pointer;
}

.tag-picker-item:hover:not(:disabled) {
  border-color: rgba(255, 138, 31, 0.45);
  background: rgba(255, 138, 31, 0.08);
}

.tag-picker-item:disabled,
.tag-picker-item.on-server {
  opacity: 0.55;
  cursor: default;
}

.server-tags-cell {
  text-align: left;
  vertical-align: top;
  max-width: 240px;
}

.server-tags-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.server-tags-cell .tag-chip-row-compact {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }

  .settings-grid,
  .stats-grid,
  .controls-grid,
  .dashboard-health-strip,
  .dashboard-action-main,
  .billing-terms-grid,
  .notif-center-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .notif-feed-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .notif-pagination {
    justify-content: space-between;
  }

  .scope-switcher-trigger {
    min-width: 0;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .history-charts-grid {
    grid-template-columns: 1fr;
  }

  .org-settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .server-table thead {
    display: none;
  }

  .server-table tbody tr,
  .server-table tbody td {
    display: block;
    width: 100%;
  }

  .server-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* —— Admin console —— */
.admin-shell .admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background var(--motion-fast) var(--ease-soft), border-color var(--motion-fast) var(--ease-soft);
}

.admin-nav-link:hover {
  border-color: var(--border-strong);
  background: var(--surface-elevated);
}

.admin-nav-link.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-card h2 {
  margin-top: 0;
}

.admin-card-lead {
  margin-top: 0;
  margin-bottom: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table-row-click {
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-soft);
}

.admin-table-row-click:hover,
.admin-table-row-click:focus-visible {
  background: rgba(255, 138, 31, 0.06);
  outline: none;
}

.admin-table-muted {
  color: var(--muted);
  font-size: 0.88em;
}

.admin-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-detail-head h2 {
  margin: 0;
}

.admin-back {
  flex-shrink: 0;
}

.admin-dl {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 8px 16px;
  margin: 0 0 20px;
}

.admin-dl dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-dl dd {
  margin: 0;
}

.admin-subheading {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.admin-link-list {
  margin: 0;
  padding-left: 1.2rem;
}

.admin-link-list a {
  color: var(--accent);
  text-decoration: none;
}

.admin-link-list a:hover {
  text-decoration: underline;
}

.admin-transfer {
  margin: 16px 0 20px;
  padding: 14px 16px;
}

.admin-transfer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.admin-field-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.admin-field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-org-projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-project-block {
  align-items: stretch;
}
