/* Design tokens — Tabler-inspired shell, WB brand colors */
:root {
  --wb-magenta: #cb11ab;
  --wb-magenta-2: #a30d8a;
  --wb-violet: #481173;
  --wb-violet-2: #2b0856;
  --wb-pink: #ff66b8;
  --wb-bg: #fafafe;
  --wb-bg-2: #f3eef9;
  --wb-card: #ffffff;
  --wb-text: #14001f;
  --wb-text-muted: #6f6580;
  --wb-line: #ebe4f5;
  --wb-line-strong: #d9cdee;
  --wb-ok: #18a86b;
  --wb-err: #e23a4a;
  --wb-warn: #d97706;
  --wb-info: #2563eb;
  --shadow-sm: 0 1px 2px rgba(72, 17, 115, 0.06);
  --shadow-md: 0 8px 24px rgba(72, 17, 115, 0.10);
  --shadow-lg: 0 16px 40px rgba(72, 17, 115, 0.14);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --app-topbar-h: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  margin: 0;
  background:
    radial-gradient(1200px 600px at 100% -10%, #ffe6f6 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 0%, #ece2ff 0%, transparent 60%),
    var(--wb-bg);
  color: var(--wb-text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--wb-magenta);
  text-decoration: none;
}

a:hover {
  color: var(--wb-violet);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--wb-violet) 0%, var(--wb-magenta) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

.topbar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.topbar__right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar__dropdown-wrap {
  position: relative;
  flex-shrink: 0;
}

.topbar__logout-wrap {
  flex-shrink: 0;
}

.topbar__logout-wrap form {
  margin: 0;
  display: block;
}

.topbar__nav {
  flex: 1;
  min-width: 0;
}

.topbar__btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  min-height: 36px;
  box-shadow: none;
}

.topbar__btn:hover {
  transform: none;
  box-shadow: none;
}

.topbar .topbar__btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.topbar .topbar__btn.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.login {
  max-width: 460px;
  margin: 60px auto 0;
}

.login__card h2 {
  margin-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  user-select: none;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--wb-magenta);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.brand__name {
  opacity: 0.95;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nav--admin {
  flex: 1;
}

.nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav a.is-active,
.nav-dropdown__toggle.is-active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.nav-dropdown {
  position: relative;
  flex-shrink: 0;
}

.topbar__right button.nav-dropdown__toggle {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.nav-menu-icon {
  width: 22px;
  height: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.nav-menu-icon__line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: center;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.22s ease;
}

.nav-dropdown.is-open .nav-menu-icon__line--1 {
  transform: translateY(7px) rotate(45deg);
}

.nav-dropdown.is-open .nav-menu-icon__line--2 {
  opacity: 0;
}

.nav-dropdown.is-open .nav-menu-icon__line--3 {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-dropdown__menu:not([hidden]) {
  animation: navMenuDropIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes navMenuDropIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nav-dropdown__menu a {
  opacity: 0;
  animation: navMenuItemIn 0.28s ease forwards;
}

.nav-dropdown__menu:not([hidden]) a:nth-child(1) { animation-delay: 0.04s; }
.nav-dropdown__menu:not([hidden]) a:nth-child(2) { animation-delay: 0.07s; }
.nav-dropdown__menu:not([hidden]) a:nth-child(3) { animation-delay: 0.10s; }
.nav-dropdown__menu:not([hidden]) a:nth-child(4) { animation-delay: 0.13s; }

@keyframes navMenuItemIn {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.topbar .nav-dropdown__toggle {
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-family: inherit;
  margin: 0;
  box-shadow: none;
  min-height: 36px;
  width: auto;
  filter: none;
}

.topbar .nav-dropdown__toggle:hover,
.topbar .nav-dropdown__toggle.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: none;
  box-shadow: none;
  filter: none;
}

.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 200px;
  margin: 0;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--wb-line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(72, 17, 115, 0.24);
  z-index: 500;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.nav-dropdown__menu[hidden] {
  display: none !important;
}

.nav-dropdown__menu:not([hidden]) {
  display: flex;
}

.nav-dropdown__menu a {
  display: block;
  width: 100%;
  color: var(--wb-text);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.nav-dropdown__menu a:hover {
  background: var(--wb-bg-2);
  color: var(--wb-violet);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--wb-text-muted);
}

.breadcrumbs a {
  color: var(--wb-magenta);
}

.breadcrumbs__current {
  color: var(--wb-text);
  font-weight: 600;
}

.breadcrumbs__sep {
  opacity: 0.5;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi__label {
  font-size: 13px;
  color: var(--wb-text-muted);
  font-weight: 500;
}

.kpi strong {
  font-size: 28px;
  line-height: 1.1;
  color: var(--wb-violet);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 20px;
}

.row-link__title {
  font-weight: 600;
}

.log-text {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form select {
  min-width: 160px;
}

/* ---------- Layout ---------- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
}

.hint {
  color: var(--wb-text-muted);
  font-size: 14px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--wb-card);
  border: 1px solid var(--wb-line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  animation: cardIn 380ms ease both;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.grid .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grid .card strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--wb-text-muted);
  font-weight: 600;
}

.grid .card.kpi {
  gap: 4px;
}

.grid .card.kpi::after {
  display: none;
}

.grid .card.kpi strong {
  font-size: 28px;
  line-height: 1.1;
  color: var(--wb-violet);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.grid .card::after {
  content: "";
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wb-magenta), var(--wb-pink));
  margin-top: 10px;
  width: 36px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------- Campaign builder ---------- */

.builder-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--wb-line);
}

.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.builder-toolbar h3 {
  margin: 0;
}

.builder-add-btn {
  margin-top: 0;
}

.builder-table input,
.builder-table textarea {
  margin-top: 0;
}

.builder-table .builder-remove-btn {
  margin-top: 0;
  padding: 6px 10px;
  font-size: 12px;
}

.builder-repeat-extra {
  margin-top: 8px;
}

.builder-excel-import summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--wb-violet);
}

.builder-excel-import[open] summary {
  margin-bottom: 12px;
}

/* ---------- Forms ---------- */

.form label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--wb-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--wb-text);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--wb-magenta);
  box-shadow: 0 0 0 3px rgba(203, 17, 171, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 18px;
  background: linear-gradient(90deg, var(--wb-magenta), var(--wb-pink));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  box-shadow: 0 6px 14px rgba(203, 17, 171, 0.25);
  width: auto;
}

button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(203, 17, 171, 0.32);
  filter: saturate(1.05);
}

button:active, .btn:active {
  transform: translateY(0);
}

button.secondary, .btn.secondary {
  background: linear-gradient(90deg, var(--wb-violet), #6b1ea8);
  box-shadow: 0 6px 14px rgba(72, 17, 115, 0.30);
}

button.ghost, .btn.ghost {
  background: #fff;
  color: var(--wb-magenta);
  border: 1px solid var(--wb-line-strong);
  box-shadow: none;
  border-radius: 8px;
}

button.ghost:hover, .btn.ghost:hover {
  border-color: var(--wb-magenta);
  background: #fff5fb;
  transform: none;
}

/* table-action buttons */
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  vertical-align: middle;
}

.table-actions .btn,
.table-actions button,
table form button {
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  margin-top: 0;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--wb-line);
  font-size: 14px;
}

thead {
  background: linear-gradient(90deg, #f7f0fb, #fdf3f9);
}

th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--wb-violet);
  padding: 12px 14px;
  border-bottom: 1px solid var(--wb-line);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wb-line);
  vertical-align: top;
  color: var(--wb-text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #faf6fd;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
}

.review-text-cell {
  min-width: 320px;
  max-width: 640px;
}

.review-text-full {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

pre {
  background: #faf6fd;
  border: 1px solid var(--wb-line);
  padding: 12px 14px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  color: #34234a;
}

/* ---------- Alerts ---------- */

.alert {
  border-left: 3px solid var(--wb-magenta);
}

.alert.success {
  border-left-color: var(--wb-ok);
  background: #f1fbf6;
}

.alert.error {
  border-left-color: var(--wb-err);
  background: #fdf2f3;
}

.alert.warn {
  border-left-color: #d4a017;
  background: #fff9eb;
}

.api-key-scope-warning {
  margin-bottom: 12px;
}

/* ---------- Misc ---------- */

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 0;
}

.btn-animated {
  animation: popIn 360ms ease both;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: var(--wb-text);
  font-size: 14px;
  cursor: pointer;
}

.radio input {
  width: auto;
}

.fade-in {
  animation: fadeUp 380ms ease both;
}

.fade-in-delayed {
  animation: fadeUp 520ms ease both;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 0, 31, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay__content {
  background: #fff;
  border: 1px solid var(--wb-line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--wb-violet);
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(203, 17, 171, 0.2);
  border-top-color: var(--wb-magenta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.loading-active {
  cursor: progress;
}

body.loading-active button,
body.loading-active .btn {
  cursor: progress;
}

.wb-export-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
  margin-top: 14px;
  vertical-align: top;
}

.wb-export-inline .btn,
.wb-export-inline button {
  margin-top: 0;
}

.wb-export-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.wb-export-progress__track {
  width: 140px;
  height: 8px;
  background: rgba(203, 17, 171, 0.15);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.wb-export-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--wb-magenta), var(--wb-violet));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.wb-export-progress__label {
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-lead p:first-child {
  margin-top: 0;
}

.guide-list {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.guide-list li {
  margin-bottom: 0.55rem;
}

.guide-list li:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .grid-2, .actions-row {
    grid-template-columns: 1fr;
  }

  .topbar__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar__right {
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .topbar__nav {
    width: 100%;
    order: 3;
  }

  .container {
    padding: 18px 14px 32px;
  }

  h2 {
    font-size: 22px;
  }
}

/* Topbar: overrides after global button styles */
.topbar__right button.nav-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  box-shadow: none;
  filter: none;
  transform: none;
  cursor: pointer;
}

.topbar__right button.nav-dropdown__toggle:hover,
.topbar__right button.nav-dropdown__toggle.is-active,
.nav-dropdown.is-open .nav-dropdown__toggle {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: none;
  box-shadow: none;
  filter: none;
}

.topbar__right button.topbar__btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 14px;
  min-height: 36px;
  width: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
  filter: none;
  transform: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}

.topbar__right button.topbar__btn-logout:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: none;
  box-shadow: none;
  filter: none;
}

.topbar .nav-dropdown__menu:not([hidden]) {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* ---------- Auth screen (login / register) ---------- */

.auth-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.auth-screen__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1px minmax(300px, 34%);
  min-height: 100vh;
  width: 100%;
}

.auth-screen__features {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 48px 48px 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background: #fafafa;
  color: var(--wb-text);
}

.auth-screen__features > *:not(.auth-screen__mosaic) {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
}

/* Мозаика как у Fireworks: мягкие квадраты, плотнее справа снизу */
.auth-screen__mosaic {
  position: absolute;
  right: -6%;
  bottom: -8%;
  width: min(98%, 980px);
  height: min(96%, 920px);
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Crect x='3' y='3' width='30' height='30' rx='5' fill='%23a78bfa' fill-opacity='0.38'/%3E%3Crect x='39' y='3' width='30' height='30' rx='5' fill='%23a78bfa' fill-opacity='0.22'/%3E%3Crect x='3' y='39' width='30' height='30' rx='5' fill='%23a78bfa' fill-opacity='0.28'/%3E%3Crect x='39' y='39' width='30' height='30' rx='5' fill='%23b794f6' fill-opacity='0.45'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  background-repeat: repeat;
  -webkit-mask-image: radial-gradient(ellipse 95% 90% at 100% 100%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 95% 90% at 100% 100%, #000 20%, transparent 78%);
  opacity: 0.95;
  animation: authMosaicDrift 26s ease-in-out infinite;
}

.auth-screen__mosaic::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 95% 95%, rgba(203, 17, 171, 0.07), transparent 65%);
  pointer-events: none;
}

@keyframes authMosaicDrift {
  0%, 100% {
    background-position: 0 0;
    opacity: 0.88;
  }
  50% {
    background-position: 12px -10px;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-screen__mosaic {
    animation: none;
  }
}

.auth-screen__brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-screen__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #ff5ec8 0%, var(--wb-magenta) 42%, #7c3aed 100%);
  box-shadow:
    0 10px 28px rgba(203, 17, 171, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.05em;
}

.auth-screen__brand {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--wb-text);
  line-height: 1.1;
}

.auth-screen__intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  justify-content: center;
  max-width: min(34em, 100%);
}

.auth-screen__headline {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  color: var(--wb-text);
  max-width: none;
}

.auth-screen__lead {
  margin: 0;
  color: var(--wb-text-muted);
  font-size: 17px;
  max-width: none;
  line-height: 1.45;
}

.auth-screen__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(36em, 100%);
}

.auth-screen__list li {
  position: relative;
  padding-left: 18px;
  color: var(--wb-text);
  font-size: 15px;
}

.auth-screen__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wb-magenta);
  opacity: 0.75;
}

.auth-screen__divider {
  background: #ececef;
  width: 1px;
  min-height: 100%;
}

.auth-screen__panel {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs__item {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--wb-text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.auth-tabs__item.is-active {
  color: var(--wb-violet);
  background: #fff;
  border-color: var(--wb-line-strong);
}

.auth-mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-mode-switch a {
  font-size: 13px;
  font-weight: 600;
  color: var(--wb-text-muted);
  padding: 6px 10px;
  border-radius: 8px;
}

.auth-mode-switch a.is-active {
  color: var(--wb-magenta);
  background: rgba(203, 17, 171, 0.08);
}

.auth-form label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
  font-size: 13px;
}

.auth-form input {
  width: 100%;
}

.auth-form button {
  width: 100%;
  margin-top: 16px;
}

.auth-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.alert.ok {
  background: rgba(24, 168, 107, 0.1);
  color: #0f7a4c;
  border: 1px solid rgba(24, 168, 107, 0.25);
}

@media (max-width: 900px) {
  .auth-screen__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .auth-screen__divider {
    width: 100%;
    height: 1px;
  }

  .auth-screen__features {
    padding: 32px 24px 28px;
    order: 2;
    justify-content: flex-start;
    gap: 20px;
    min-height: auto;
  }

  .auth-screen__intro {
    flex: none;
  }

  .auth-screen__mosaic {
    width: min(100%, 520px);
    height: min(70%, 360px);
  }

  .auth-screen__panel {
    order: 1;
    padding: 28px 22px 24px;
    min-height: auto;
  }

  .auth-screen__headline {
    max-width: none;
  }
}

/* ---------- App shell (Tabler-inspired) ---------- */

body.app-shell {
  display: flex;
  min-height: 100%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: var(--sidebar-w);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--wb-violet-2) 0%, var(--wb-violet) 55%, #3a0d5c 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: width 0.28s ease;
}

.sidebar__brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 12px 16px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: padding 0.28s ease;
}

.sidebar__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
}

.sidebar__brand-link:hover {
  color: #fff;
}

.sidebar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #ff5ec8 0%, var(--wb-magenta) 42%, #7c3aed 100%);
  box-shadow:
    0 8px 20px rgba(203, 17, 171, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sidebar__brand-monogram {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(72, 17, 115, 0.35);
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  opacity: 1;
  max-width: 160px;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.28s ease;
}

.sidebar__brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.sidebar__brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.2;
}

/* legacy aliases (если где-то остались) */
.sidebar__mark,
.sidebar__name {
  display: none;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 24px;
  transition: padding 0.28s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar__nav::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sidebar__group {
  margin-bottom: 14px;
}

.sidebar__group-label {
  margin: 0 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  max-height: 24px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease, max-height 0.28s ease, margin 0.28s ease;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, padding 0.28s ease, justify-content 0.28s ease;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar__link.is-active {
  background: linear-gradient(90deg, rgba(203, 17, 171, 0.55), rgba(255, 102, 184, 0.28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar__ico {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  opacity: 0.85;
  font-size: 13px;
  line-height: 1;
}

.sidebar__label {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease, max-width 0.28s ease;
}

.sidebar__collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar__collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sidebar__collapse-btn .sidebar__ico {
  width: auto;
  font-size: 20px;
  line-height: 1;
  opacity: 1;
}

@media (min-width: 981px) {
  body.sidebar-collapsed {
    --sidebar-w: var(--sidebar-w-collapsed);
  }

  body.sidebar-collapsed .sidebar__brand {
    flex-direction: column;
    justify-content: center;
    padding: 12px 8px;
    gap: 6px;
  }

  body.sidebar-collapsed .sidebar__brand-link {
    gap: 0;
    justify-content: center;
    order: 2;
  }

  body.sidebar-collapsed .sidebar__collapse-btn {
    order: 1;
  }

  body.sidebar-collapsed .sidebar__brand-text,
  body.sidebar-collapsed .sidebar__label {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-collapsed .sidebar__group-label {
    max-height: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-collapsed .sidebar__nav {
    padding: 12px 8px 16px;
  }

  body.sidebar-collapsed .sidebar__link {
    justify-content: center;
    gap: 0;
    padding: 9px 0;
  }

  body.sidebar-collapsed .sidebar__collapse-btn .sidebar__ico {
    transform: scaleX(-1);
  }
}

.app-frame {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  transition: margin-left 0.28s ease;
}

body.app-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--app-topbar-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  color: var(--wb-text);
  border-bottom: 1px solid var(--wb-line);
  box-shadow: none;
}

body.app-shell .topbar__inner {
  max-width: none;
  margin: 0;
  padding: 10px 20px;
  gap: 12px;
}

body.app-shell .topbar__right {
  margin-left: auto;
}

.topbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--wb-line-strong);
  background: #fff;
  color: var(--wb-violet);
  cursor: pointer;
  box-shadow: none;
  transform: none;
  filter: none;
}

.topbar__menu-btn:hover {
  background: var(--wb-bg-2);
  transform: none;
  box-shadow: none;
}

.cabinet-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cabinet-switcher__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wb-text-muted);
  white-space: nowrap;
}

.cabinet-switcher select {
  min-width: 160px;
  max-width: 280px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--wb-line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--wb-text);
}

body.app-shell .topbar__btn-logout {
  color: var(--wb-violet) !important;
  background: var(--wb-bg-2) !important;
  border: 1px solid var(--wb-line-strong) !important;
}

body.app-shell .topbar__btn-logout:hover {
  background: #ebe4f5 !important;
}

body.app-shell .topbar__right button.topbar__btn-logout {
  color: var(--wb-violet);
  background: var(--wb-bg-2);
  border: 1px solid var(--wb-line-strong);
}

.sidebar-backdrop {
  display: none;
}

body.app-shell > .container,
body.app-shell .app-frame > .container {
  flex: 1;
  width: 100%;
  max-width: 1280px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge--ok {
  color: #0f6b45;
  background: rgba(24, 168, 107, 0.12);
  border-color: rgba(24, 168, 107, 0.22);
}

.badge--err,
.badge--danger {
  color: #a31f2d;
  background: rgba(226, 58, 74, 0.1);
  border-color: rgba(226, 58, 74, 0.2);
}

.badge--warn {
  color: #92400e;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.22);
}

.badge--muted {
  color: var(--wb-text-muted);
  background: var(--wb-bg-2);
  border-color: var(--wb-line);
}

.badge--info {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
}

.badge--magenta {
  color: var(--wb-magenta-2);
  background: rgba(203, 17, 171, 0.1);
  border-color: rgba(203, 17, 171, 0.2);
}

/* ---------- Empty state ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 36px 20px;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--wb-bg-2);
  color: var(--wb-violet);
  font-size: 22px;
  margin-bottom: 4px;
}

.empty-state__title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  color: var(--wb-text);
}

.empty-state__text {
  margin: 0 0 8px;
  max-width: 420px;
  color: var(--wb-text-muted);
  font-size: 14px;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--wb-line);
}

.pagination__meta {
  font-size: 13px;
  color: var(--wb-text-muted);
}

.pagination__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--wb-line);
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 500;
}

.pagination__page:hover {
  background: var(--wb-bg-2);
  color: var(--wb-violet);
}

.pagination__page.is-active {
  background: var(--wb-magenta);
  border-color: var(--wb-magenta);
  color: #fff;
}

.pagination__ellipsis {
  color: var(--wb-text-muted);
  padding: 0 4px;
}

.btn.btn-sm,
button.btn-sm,
a.btn.btn-sm {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn.is-disabled,
span.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.table-toolbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Attention / dashboard widgets ---------- */

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.attention-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid var(--wb-line-strong);
}

.attention-card:hover {
  color: inherit;
  transform: translateY(-1px);
}

.attention-card--warn {
  border-left-color: var(--wb-warn);
}

.attention-card--danger {
  border-left-color: var(--wb-err);
}

.attention-card--info {
  border-left-color: var(--wb-info);
}

.attention-card--ok {
  border-left-color: var(--wb-ok);
}

.attention-card__label {
  font-size: 13px;
  color: var(--wb-text-muted);
  font-weight: 500;
}

.attention-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--wb-violet);
  line-height: 1.1;
}

.attention-card__hint {
  font-size: 12px;
  color: var(--wb-text-muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--wb-bg);
  border: 1px solid var(--wb-line);
  font-size: 14px;
}

.checklist__item.is-done {
  opacity: 0.72;
}

.checklist__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--wb-bg-2);
  color: var(--wb-text-muted);
  border: 1px solid var(--wb-line-strong);
}

.checklist__item.is-done .checklist__mark {
  background: rgba(24, 168, 107, 0.15);
  color: var(--wb-ok);
  border-color: rgba(24, 168, 107, 0.3);
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--wb-bg-2);
  border: 1px solid var(--wb-line);
  color: var(--wb-text-muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    width: 248px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar__collapse-btn {
    display: none;
  }

  .app-frame {
    margin-left: 0;
    transition: none;
  }

  .topbar__menu-btn {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(20, 0, 31, 0.4);
    backdrop-filter: blur(1px);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .cabinet-switcher__label {
    display: none;
  }

  .cabinet-switcher select {
    min-width: 120px;
    max-width: 180px;
  }
}

/* API key guide (accounts / cabinets) */
.api-key-guide {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--wb-line);
  background: var(--wb-bg);
}

.api-key-guide summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--wb-magenta);
  list-style: none;
}

.api-key-guide summary::-webkit-details-marker {
  display: none;
}

.api-key-guide__body {
  margin-top: 10px;
  font-size: 14px;
  color: var(--wb-text-muted);
}

.api-key-guide__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.api-key-guide__tags li {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(203, 17, 171, 0.1);
  color: var(--wb-magenta-2);
  border: 1px solid rgba(203, 17, 171, 0.2);
}

/* Subscription / trial */
.sidebar__footer {
  flex-shrink: 0;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-sub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3eef9;
}

.sidebar-sub__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  text-transform: uppercase;
}

.sidebar-sub__time {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sidebar-sub--expired .sidebar-sub__label {
  color: #ffb4c8;
}

.sidebar-sub__btn {
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--wb-magenta), var(--wb-magenta-2));
  display: inline-block;
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
}

body.sidebar-collapsed .sidebar__footer .sidebar-sub__label,
body.sidebar-collapsed .sidebar__footer .sidebar-sub__time,
body.sidebar-collapsed .sidebar__footer .sidebar-sub__btn {
  display: none;
}

.sub-gate {
  position: relative;
  isolation: isolate;
}

.sub-gate__blur {
  filter: blur(4px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.sub-gate__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(250, 250, 254, 0.35);
  z-index: 2;
}

.sub-gate__card {
  max-width: 360px;
  text-align: center;
  padding: 22px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--wb-line);
  box-shadow: 0 16px 40px rgba(72, 17, 115, 0.12);
}

.sub-gate__lock {
  font-size: 28px;
  line-height: 1;
}

.sub-gate__title {
  margin: 10px 0 6px;
  color: var(--wb-violet);
}

.sub-gate__hint {
  margin: 0 0 14px;
  color: var(--wb-text-muted);
  font-size: 14px;
}

.sub-buy-modal {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(20, 0, 31, 0.25);
}

.sub-buy-modal::backdrop {
  background: rgba(20, 0, 31, 0.45);
}

.sub-buy-modal__panel {
  margin: 0;
  padding: 22px 20px;
}

.sub-buy-modal__panel h3 {
  margin: 0 0 8px;
  color: var(--wb-violet);
}

.sub-buy-modal__panel p {
  margin: 0 0 16px;
  color: var(--wb-text-muted);
}

.admin-sub-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-sub-summary__item {
  padding: 14px;
  border-radius: 12px;
  background: var(--wb-bg-2);
  border: 1px solid var(--wb-line);
}

.admin-sub-summary__item strong {
  display: block;
  font-size: 22px;
  color: var(--wb-violet);
}

.admin-filter-bar {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--wb-line);
  background: color-mix(in srgb, var(--wb-bg-2) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.admin-filter-bar__input {
  flex: 1 1 240px;
  min-width: 180px;
  margin: 0;
}

.admin-filter-bar__meta {
  flex: 1 1 100%;
  margin: 0;
  min-height: 1.2em;
}

.admin-filter-hit {
  outline: 2px solid var(--wb-violet);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--wb-violet) 12%, transparent) !important;
}

tr.admin-filter-hit td {
  background: transparent;
}

.admin-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.admin-filter-chip {
  border: 1px solid var(--wb-line);
  background: var(--wb-bg-2);
  color: var(--wb-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}

.admin-filter-chip.is-active {
  border-color: var(--wb-violet);
  background: color-mix(in srgb, var(--wb-violet) 12%, transparent);
}

.admin-sub-summary__item--btn {
  cursor: pointer;
  text-align: left;
  border: 1px solid transparent;
  width: 100%;
  font: inherit;
}

.admin-sub-summary__item--btn:hover {
  border-color: var(--wb-line);
}

.admin-ws-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 0;
}

.admin-ws-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-ws-card__meta {
  margin: 6px 0 0;
  flex: 1 1 100%;
}

.admin-ws-card__details {
  margin-top: 12px;
}

.admin-ws-card__details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--wb-violet);
  user-select: none;
}

.admin-badge {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.admin-badge--trial {
  background: #fff4e5;
  color: #9a6700;
}

.admin-badge--paid {
  background: #f1fbf6;
  color: #1a7f4b;
}

.admin-badge--expired {
  background: #fdf2f3;
  color: #b42318;
}

.admin-create-panel > summary {
  cursor: pointer;
  font-weight: 600;
}

.pc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.pc-summary__item {
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--wb-line);
}

.pc-summary__item strong {
  display: block;
  font-size: 20px;
  color: var(--wb-violet);
}

.pc-status-ok { color: var(--wb-ok); font-weight: 600; }
.pc-status-dispute { color: var(--wb-err); font-weight: 600; }
.pc-status-missing { color: var(--wb-warn); font-weight: 600; }
.pc-status-excluded { color: var(--wb-text-muted); font-weight: 600; }

