:root {
  color-scheme: dark;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.m2-body,
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  font-size: 15px;
  color: #eef3ff;
  background:
    linear-gradient(160deg, rgba(37, 91, 255, 0.22) 0%, rgba(37, 91, 255, 0) 48%),
    linear-gradient(15deg, rgba(19, 202, 175, 0.18) 0%, rgba(19, 202, 175, 0) 45%),
    #050914;
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

.m2-body *,
body * {
  min-width: 0;
}

.m2-body button,
.m2-body input,
.m2-body select,
.m2-body textarea,
.m2-body a,
button,
input,
select,
textarea,
a {
  font: inherit;
}

.m2-body h1,
.m2-body h2,
.m2-body h3,
body h1,
body h2,
body h3 {
  letter-spacing: 0.01em;
}

.m2-body h1,
body h1 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
}

.m2-body h2,
body h2 {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
}

.m2-body p,
body p {
  line-height: 1.5;
}

.m2-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.m2-sidebar {
  border-right: 1px solid rgba(119, 146, 235, 0.26);
  position: -webkit-sticky;
  padding: 26px 18px 22px;
  background: rgba(8, 14, 32, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.m2-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f6f8ff;
  text-decoration: none;
  margin-bottom: 20px;
}

.m2-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #4f7bff, #2fd6bb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
}

.m2-brand-title,
.m2-brand-sub {
  display: block;
  line-height: 1.1;
}

.m2-brand-title {
  font-size: 15px;
  font-weight: 700;
}

.m2-brand-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #a4b5df;
}

.m2-nav {
  display: grid;
  gap: 8px;
}

.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link {
  border: 1px solid rgba(127, 155, 241, 0.3);
  border-radius: 13px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  color: #cfdcff;
  text-decoration: none;
  background: rgba(13, 21, 45, 0.45);
  transition: 0.16s ease;
  font-weight: 600;
}

.m2-nav-link:hover,
.m2-sidebar-logout:hover,
.m2-chip-link:hover {
  border-color: rgba(159, 199, 255, 0.55);
  color: #f4f8ff;
}

.m2-nav-link.is-active,
.m2-chip-link.is-active {
  color: #06122c;
  border-color: transparent;
  background: linear-gradient(135deg, #89a6ff, #6ef1d9);
}

.m2-sidebar-logout {
  margin-top: 18px;
  border-color: rgba(255, 133, 160, 0.4);
  color: #ffb6cb;
}

.m2-content-wrap {
  padding: 20px;
}

.m2-topbar {
  background: rgba(9, 16, 35, 0.7);
  border: 1px solid rgba(120, 150, 236, 0.3);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 14px 32px rgba(7, 12, 26, 0.35);
}

.m2-topbar-title {
  font-size: 18px;
  font-weight: 800;
}

.m2-topbar-sub {
  margin-top: 4px;
  color: #9cb0df;
  font-size: 13px;
}

.m2-content {
  margin-top: 14px;
}

.m2-card {
  background: linear-gradient(180deg, rgba(15, 23, 48, 0.92), rgba(12, 19, 37, 0.95));
  border: 1px solid rgba(123, 149, 230, 0.25);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 34px rgba(4, 8, 19, 0.42);
}

.m2-card h1,
.m2-card h2,
.m2-card h3 {
  margin: 0;
}

.m2-stack-16 {
  margin-top: 16px;
}

.m2-muted {
  color: #9fb2dc;
}

.m2-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.m2-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.m2-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.m2-auth-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
}

.m2-auth-side {
  border: 1px solid rgba(122, 150, 235, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(10, 18, 38, 0.66);
}

.m2-auth-main {
  border: 1px solid rgba(122, 150, 235, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(10, 18, 38, 0.66);
}

.m2-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.m2-hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 245, 223, 0.3), transparent 68%);
  pointer-events: none;
}

.m2-actions,
.m2-actions-wrap,
.m2-chip-row,
.m2-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m2-actions-wrap .m2-btn,
.m2-inline-form .m2-btn {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 10px;
}

.m2-actions-wrap .m2-input,
.m2-inline-form .m2-input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.m2-btn {
  border: 0;
  border-radius: 13px;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, #6f91ff, #3be0c3);
  color: #051126;
  box-shadow: 0 10px 24px rgba(74, 132, 255, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.m2-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(74, 132, 255, 0.34);
}

.m2-btn-ghost {
  background: rgba(16, 27, 55, 0.7);
  color: #dbe6ff;
  border: 1px solid rgba(127, 155, 241, 0.35);
  box-shadow: none;
}

.m2-btn-danger {
  background: rgba(167, 42, 80, 0.35);
  border: 1px solid rgba(255, 129, 162, 0.55);
  color: #ffd8e3;
  box-shadow: none;
}

.m2-form-grid {
  display: grid;
  gap: 12px;
}

.m2-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.m2-input,
.m2-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.m2-body select,
.m2-body textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(127, 155, 241, 0.33);
  background: rgba(7, 13, 29, 0.88);
  color: #ecf2ff;
}

.m2-body input[type="checkbox"],
.m2-body input[type="radio"] {
  width: auto;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: #6ef1d9;
}

.m2-body textarea,
textarea {
  min-height: 96px;
  resize: vertical;
}

.m2-notice {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 155, 241, 0.32);
  background: rgba(16, 27, 56, 0.74);
}

.m2-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(123, 149, 230, 0.22);
  border: 1px solid rgba(123, 149, 230, 0.35);
  font-size: 12px;
  color: #cedbff;
}

.m2-success {
  border-color: rgba(78, 228, 199, 0.55);
  background: rgba(24, 121, 103, 0.24);
}

.m2-error {
  border-color: rgba(255, 131, 165, 0.58);
  background: rgba(145, 30, 62, 0.3);
}

.m2-table-wrap {
  overflow: auto;
}

.m2-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.m2-table th,
.m2-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(121, 148, 229, 0.2);
  text-align: left;
  vertical-align: top;
}

.m2-table thead th {
  color: #b7c8ef;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.m2-metric-card {
  min-height: 124px;
}

.m2-kicker {
  color: #9cb0df;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.m2-metric {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.m2-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.m2-tariff-item {
  border: 1px solid rgba(122, 150, 235, 0.26);
  border-radius: 14px;
  padding: 14px;
  background: rgba(10, 17, 35, 0.66);
}

.m2-chip {
  display: inline-flex;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  align-items: center;
  background: rgba(111, 145, 255, 0.2);
  border: 1px solid rgba(111, 145, 255, 0.4);
  color: #b8caff;
  font-size: 12px;
}

.m2-props p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed rgba(120, 148, 229, 0.24);
  padding: 8px 0;
}

.m2-props span {
  color: #a3b7e4;
}

.m2-list-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.m2-break-all {
  word-break: break-all;
}

.m2-install-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m2-install-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.m2-install-sidebar,
.m2-install-main {
  border: 1px solid rgba(122, 150, 235, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(10, 18, 38, 0.66);
}

.m2-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m2-platform-tab,
.m2-app-btn {
  border: 1px solid rgba(127, 155, 241, 0.3);
  border-radius: 12px;
  background: rgba(13, 21, 45, 0.45);
  color: #d7e3ff;
  min-height: 40px;
  padding: 10px 12px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
  transition: 0.16s ease;
  font-weight: 600;
}

.m2-platform-tab:hover,
.m2-app-btn:hover {
  border-color: rgba(159, 199, 255, 0.55);
  color: #f4f8ff;
}

.m2-platform-tab.is-active,
.m2-app-btn.is-active {
  color: #07132f;
  border-color: transparent;
  background: linear-gradient(135deg, #89a6ff, #6ef1d9);
}

.m2-apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.m2-app-card {
  border: 1px solid rgba(122, 150, 235, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 15, 31, 0.65);
}

.m2-body a {
  color: #a8c8ff;
}

/* Compatibility layer for default templates (fallback pages) */
.card {
  background: linear-gradient(180deg, rgba(15, 23, 48, 0.92), rgba(12, 19, 37, 0.95));
  border: 1px solid rgba(123, 149, 230, 0.25);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 34px rgba(4, 8, 19, 0.42);
}

.inner {
  background: rgba(10, 17, 35, 0.66);
  border: 1px solid rgba(122, 150, 235, 0.24);
}

.btn {
  border: 0;
  border-radius: 13px;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, #6f91ff, #3be0c3);
  color: #051126;
  box-shadow: 0 10px 24px rgba(74, 132, 255, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.notice {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 155, 241, 0.32);
  background: rgba(16, 27, 56, 0.74);
}

.notice.success {
  border-color: rgba(78, 228, 199, 0.55);
  background: rgba(24, 121, 103, 0.24);
}

.notice.error {
  border-color: rgba(255, 131, 165, 0.58);
  background: rgba(145, 30, 62, 0.3);
}

.muted {
  color: #9fb2dc;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-link {
  border: 1px solid rgba(127, 155, 241, 0.3);
  border-radius: 13px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  color: #cfdcff;
  text-decoration: none;
  background: rgba(13, 21, 45, 0.45);
  transition: 0.16s ease;
  font-weight: 600;
}

.top-link:hover {
  border-color: rgba(159, 199, 255, 0.55);
  color: #f4f8ff;
}

.top-link.is-active {
  color: #06122c;
  border-color: transparent;
  background: linear-gradient(135deg, #89a6ff, #6ef1d9);
}

input,
select,
textarea,
.admin-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(127, 155, 241, 0.33);
  background: rgba(7, 13, 29, 0.88);
  color: #ecf2ff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(121, 148, 229, 0.2);
  text-align: left;
  vertical-align: top;
}

th {
  color: #b7c8ef;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.break-all {
  word-break: break-all;
}

.m2-break-all,
.break-all,
.m2-table td,
.m2-table th,
td,
th,
.m2-props p,
.m2-kpi-pill,
.m2-chip,
.notice,
.m2-notice {
  overflow-wrap: anywhere;
}

.m2-actions > *,
.m2-actions-wrap > *,
.m2-chip-row > *,
.m2-inline-form > *,
.admin-actions > *,
.profile-menu > * {
  flex: 0 1 auto;
}

.mt16 {
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .m2-shell {
    grid-template-columns: 1fr;
  }

  .m2-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(119, 146, 235, 0.26);
  }
}

@media (max-width: 900px) {
  .m2-grid-3,
  .m2-grid-2,
  .m2-auth-grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .m2-install-grid {
    grid-template-columns: 1fr;
  }

  .m2-content-wrap {
    padding: 14px;
  }

  .m2-topbar,
  .m2-card,
  .card {
    padding: 14px;
  }

  .m2-btn,
  .btn,
  .m2-nav-link,
  .m2-sidebar-logout,
  .top-link,
  .m2-platform-tab,
  .m2-app-btn {
    width: 100%;
  }

  .m2-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== NOVA-style overhaul layer ===== */
:root {
  --nv-bg: #07080d;
  --nv-bg-soft: #0c1018;
  --nv-card: rgba(15, 18, 28, 0.88);
  --nv-card-strong: rgba(18, 22, 34, 0.94);
  --nv-border: rgba(255, 255, 255, 0.08);
  --nv-border-strong: rgba(255, 255, 255, 0.16);
  --nv-text: #f7f8fc;
  --nv-muted: #b5bdcf;
  --nv-primary: #4f7bff;
  --nv-primary-2: #6aa6ff;
  --nv-accent: #74c0ff;
  --nv-success: #31d0aa;
  --nv-danger: #ff5f7d;
  --nv-radius: 16px;
  --nv-radius-sm: 12px;
  --nv-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.m2-body,
body {
  color: var(--nv-text);
  background:
    radial-gradient(1300px 700px at 100% -10%, rgba(255, 106, 0, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(249, 115, 22, 0.12), transparent 62%),
    linear-gradient(180deg, #06070c 0%, #0a0d14 42%, #090c13 100%);
}

.m2-sidebar {
  background: linear-gradient(180deg, rgba(10, 12, 20, 0.92), rgba(14, 18, 30, 0.86));
  border-right: 1px solid var(--nv-border);
}

.m2-brand {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--nv-border);
  background: rgba(255, 255, 255, 0.02);
}

.m2-brand-logo {
  background: linear-gradient(135deg, var(--nv-primary), var(--nv-primary-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 123, 255, 0.32);
}

.m2-brand-sub {
  color: var(--nv-muted);
}

.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link,
.top-link {
  border-color: var(--nv-border);
  background: rgba(255, 255, 255, 0.015);
  color: #eceff8;
}

.m2-nav-link:hover,
.m2-sidebar-logout:hover,
.m2-chip-link:hover,
.top-link:hover {
  border-color: var(--nv-border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.m2-nav-link.is-active,
.m2-chip-link.is-active,
.top-link.is-active {
  background: linear-gradient(135deg, var(--nv-primary), var(--nv-primary-2));
  color: #fff;
  border-color: transparent;
}

.m2-sidebar-logout,
.top-link-logout {
  border-color: rgba(255, 95, 125, 0.38);
  color: #ffc0cc;
}

.m2-topbar {
  background: linear-gradient(180deg, rgba(18, 22, 34, 0.82), rgba(14, 18, 28, 0.88));
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow);
}

.m2-topbar-title {
  font-weight: 800;
}

.m2-topbar-sub,
.m2-muted,
.muted {
  color: var(--nv-muted);
}

.m2-card,
.card {
  background: linear-gradient(180deg, var(--nv-card-strong), var(--nv-card));
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow);
}

.inner,
.m2-install-sidebar,
.m2-install-main,
.m2-auth-main,
.m2-auth-side,
.m2-tariff-item,
.m2-app-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--nv-border);
}

.m2-hero-card {
  border: 1px solid rgba(106, 166, 255, 0.35);
  background:
    radial-gradient(900px 380px at -10% 0%, rgba(79, 123, 255, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(18, 22, 34, 0.92), rgba(13, 17, 27, 0.95));
}

.m2-hero-card::after {
  background: radial-gradient(circle, rgba(106, 166, 255, 0.32), transparent 68%);
}

.m2-kpi-pill,
.m2-chip {
  border: 1px solid rgba(106, 166, 255, 0.45);
  background: rgba(106, 166, 255, 0.16);
  color: #dbe9ff;
}

.m2-kicker {
  color: #c7cfdd;
}

.m2-metric {
  color: #fff;
}

.m2-notice,
.notice {
  border: 1px solid var(--nv-border-strong);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--nv-radius-sm);
}

.m2-success,
.notice.success {
  border-color: rgba(49, 208, 170, 0.55);
  background: rgba(49, 208, 170, 0.14);
}

.m2-error,
.notice.error {
  border-color: rgba(255, 95, 125, 0.55);
  background: rgba(255, 95, 125, 0.14);
}

.m2-btn,
.btn {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--nv-primary), var(--nv-primary-2));
  color: #fff;
  box-shadow: 0 10px 26px rgba(79, 123, 255, 0.3);
}

.m2-btn:hover,
.btn:hover {
  box-shadow: 0 14px 30px rgba(79, 123, 255, 0.4);
}

.m2-btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--nv-border-strong);
  color: #eff2fb;
  box-shadow: none;
}

.m2-btn-danger {
  background: rgba(255, 95, 125, 0.16);
  border: 1px solid rgba(255, 95, 125, 0.55);
  color: #ffd3dc;
}

.m2-input,
input,
select,
textarea,
.admin-input {
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--nv-text);
}

.m2-input:focus,
input:focus,
select:focus,
textarea:focus,
.admin-input:focus {
  border-color: rgba(106, 166, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(106, 166, 255, 0.2);
  outline: none;
}

.m2-table th,
th {
  color: #e7ebf5;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.m2-table td,
td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.m2-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.m2-body a,
a {
  color: #9ac6ff;
}

.m2-body a:hover,
a:hover {
  color: #c2ddff;
}

.m2-nav-group-title {
  margin: 16px 0 8px;
  color: #9ca6ba;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.m2-sidebar-footer {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.m2-sidebar-footer-title {
  color: #9ca6ba;
  font-size: 12px;
}

.m2-sidebar-footer-value {
  margin-top: 6px;
  font-weight: 800;
  color: #ffffff;
}

.m2-topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.m2-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m2-auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.m2-auth-side-lg,
.m2-auth-main-lg {
  min-height: auto;
  align-self: start;
}

.m2-auth-main,
.m2-auth-side,
.m2-form-grid,
.m2-field {
  min-width: 0;
}

.m2-auth-main {
  overflow: hidden;
}

.m2-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.m2-form-grid select,
.m2-form-grid textarea {
  min-width: 0;
  max-width: 100%;
}

.m2-feature-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #e3e8f5;
}

.m2-dashboard-hero-grid {
  align-items: stretch;
}

.m2-quick-panel {
  display: flex;
  flex-direction: column;
}

.m2-payments-top-grid {
  align-items: stretch;
}

.m2-payment-info-card {
  display: flex;
  flex-direction: column;
}

.m2-keys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.m2-chip-link,
.m2-nav-link,
.m2-platform-tab,
.m2-app-btn,
.m2-sidebar-logout,
.top-link {
  font-weight: 600;
}

.m2-props span {
  color: #d1d7e4;
}

.m2-props b {
  color: #ffffff;
}

.m2-table th,
th {
  font-weight: 700;
}

.m2-card h1,
.m2-card h2,
.m2-card h3 {
  color: #ffffff;
}

.m2-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #97a2b6;
}

@media (max-width: 900px) {
  .m2-content-wrap {
    padding: 12px;
  }

  .m2-topbar,
  .m2-card,
  .card {
    padding: 12px;
    border-radius: 14px;
  }

  .m2-auth-layout,
  .m2-dashboard-hero-grid,
  .m2-payments-top-grid {
    grid-template-columns: 1fr;
  }

  .m2-topbar-main,
  .m2-keys-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .m2-topbar-actions {
    width: 100%;
  }

  .m2-topbar-actions .m2-chip-link {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .m2-topbar-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .m2-topbar-sub,
  .m2-muted,
  .muted {
    font-size: 13px;
  }

  .m2-metric {
    font-size: 24px;
  }

  .m2-btn,
  .btn {
    min-height: 40px;
    padding: 9px 12px;
  }

  .m2-table {
    min-width: 560px;
  }

  .m2-field {
    gap: 5px;
  }
}

/* Neo v2 readability + buttons visibility */
.wc-neo-body,
.wc-neo-body .m2-content,
.wc-neo-body .m2-card,
.wc-neo-body .card,
.wc-neo-body .m2-auth-main,
.wc-neo-body .m2-auth-side,
.wc-neo-body .m2-table,
.wc-neo-body .data-table {
  color: #34406d;
}

.wc-neo-body h1,
.wc-neo-body h2,
.wc-neo-body h3,
.wc-neo-body h4,
.wc-neo-body .m2-topbar-title,
.wc-neo-body .m2-card h1,
.wc-neo-body .m2-card h2,
.wc-neo-body .m2-card h3,
.wc-neo-body .card h1,
.wc-neo-body .card h2,
.wc-neo-body .card h3 {
  color: #253160 !important;
}

.wc-neo-body p,
.wc-neo-body li,
.wc-neo-body label,
.wc-neo-body .m2-props p,
.wc-neo-body .m2-props b,
.wc-neo-body .m2-props span,
.wc-neo-body .m2-kpi-pill,
.wc-neo-body .m2-chip,
.wc-neo-body .m2-metric,
.wc-neo-body .m2-break-all,
.wc-neo-body .break-all,
.wc-neo-body .m2-notice,
.wc-neo-body .notice,
.wc-neo-body .m2-table td,
.wc-neo-body td {
  color: #34406d !important;
}

.wc-neo-body .m2-topbar-sub,
.wc-neo-body .m2-muted,
.wc-neo-body .muted,
.wc-neo-body .m2-field,
.wc-neo-body .m2-kicker,
.wc-neo-body .m2-brand-sub {
  color: #6f7ca7 !important;
}

.wc-neo-body .m2-btn,
.wc-neo-body .btn,
.wc-neo-body button,
.wc-neo-body input[type="submit"],
.wc-neo-body input[type="button"],
.wc-neo-body .m2-nav-link,
.wc-neo-body .m2-chip-link,
.wc-neo-body .top-link,
.wc-neo-body .wc-neo-nav-link,
.wc-neo-body .wc-neo-logout,
.wc-neo-body .m2-platform-tab,
.wc-neo-body .m2-app-btn {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(26, 34, 71, 0.35);
}

.wc-neo-body .m2-btn-ghost,
.wc-neo-body .btn-secondary,
.wc-neo-body .m2-btn-ghost:hover,
.wc-neo-body .btn-secondary:hover {
  color: #34406d !important;
  text-shadow: none;
}

.wc-neo-body .m2-input,
.wc-neo-body input,
.wc-neo-body select,
.wc-neo-body textarea,
.wc-neo-body .admin-input {
  color: #2f3c68;
}

.wc-neo-body .m2-input::placeholder,
.wc-neo-body input::placeholder,
.wc-neo-body textarea::placeholder {
  color: #8390bb;
}

/* Sidebar-specific contrast overrides */
.wc-neo-body .wc-neo-sidebar .wc-neo-nav-link {
  color: #2b355f !important;
  text-shadow: none;
}

.wc-neo-body .wc-neo-sidebar .wc-neo-nav-link:hover {
  color: #1f2852 !important;
}

.wc-neo-body .wc-neo-sidebar .wc-neo-nav-link.is-active {
  color: #ffffff !important;
}

/* Neo v2 contrast guard */
.wc-neo-body,
.wc-neo-body .m2-content,
.wc-neo-body .m2-card,
.wc-neo-body .card,
.wc-neo-body .m2-auth-main,
.wc-neo-body .m2-auth-side,
.wc-neo-body .m2-table,
.wc-neo-body .data-table {
  color: #1f2850;
}

.wc-neo-body h1,
.wc-neo-body h2,
.wc-neo-body h3,
.wc-neo-body h4,
.wc-neo-body .m2-topbar-title,
.wc-neo-body .m2-card h1,
.wc-neo-body .m2-card h2,
.wc-neo-body .m2-card h3,
.wc-neo-body .card h1,
.wc-neo-body .card h2,
.wc-neo-body .card h3 {
  color: #1b2348 !important;
}

.wc-neo-body p,
.wc-neo-body li,
.wc-neo-body label,
.wc-neo-body .m2-props p,
.wc-neo-body .m2-props b,
.wc-neo-body .m2-props span,
.wc-neo-body .m2-kpi-pill,
.wc-neo-body .m2-chip,
.wc-neo-body .m2-metric,
.wc-neo-body .m2-break-all,
.wc-neo-body .break-all,
.wc-neo-body .m2-notice,
.wc-neo-body .notice {
  color: #25305a !important;
}

.wc-neo-body .m2-topbar-sub,
.wc-neo-body .m2-muted,
.wc-neo-body .muted,
.wc-neo-body .m2-field,
.wc-neo-body .m2-kicker,
.wc-neo-body .m2-brand-sub {
  color: #5d6a98 !important;
}

.wc-neo-body .m2-table thead th,
.wc-neo-body thead th,
.wc-neo-body .data-table thead th,
.wc-neo-body .m2-table td,
.wc-neo-body .m2-table th,
.wc-neo-body .data-table td,
.wc-neo-body .data-table th,
.wc-neo-body td,
.wc-neo-body th {
  color: #2a3662 !important;
}

.wc-neo-body a,
.wc-neo-body .m2-content a,
.wc-neo-body .m2-card a,
.wc-neo-body .card a {
  color: #3e53c8;
}

.wc-neo-body a:hover,
.wc-neo-body .m2-content a:hover,
.wc-neo-body .m2-card a:hover,
.wc-neo-body .card a:hover {
  color: #2f43b0;
}

.wc-neo-body .m2-input,
.wc-neo-body input,
.wc-neo-body select,
.wc-neo-body textarea,
.wc-neo-body .admin-input {
  color: #1f2a53;
}

.wc-neo-body .m2-input::placeholder,
.wc-neo-body input::placeholder,
.wc-neo-body textarea::placeholder {
  color: #7b87b3;
}

.wc-neo-body .m2-notice.m2-success,
.wc-neo-body .notice.success {
  color: #1c6a4d !important;
}

.wc-neo-body .m2-notice.m2-error,
.wc-neo-body .notice.error {
  color: #8d2f52 !important;
}

/* ===== compact top-nav refactor ===== */
.m2-shell {
  display: block;
  min-height: 100vh;
}

.m2-masthead {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(8, 10, 16, 0.72);
  border-bottom: 1px solid var(--nv-border);
}

.m2-masthead-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.m2-main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.m2-main-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.m2-main-actions .m2-sidebar-logout {
  margin-top: 0;
}

.m2-main-menu {
  display: contents;
}

.m2-mobile-toggle {
  display: none;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--nv-border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--nv-text);
  font-weight: 600;
  font-size: 13px;
}

.m2-main-actions form {
  margin: 0;
}

.m2-content-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px;
}

.m2-topbar {
  padding: 10px 12px;
}

.m2-topbar-title {
  font-size: 17px;
}

.m2-topbar-sub {
  font-size: 12px;
}

.m2-content {
  margin-top: 10px;
}

.m2-card,
.card {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 13px;
}

.m2-grid {
  gap: 10px;
  margin-bottom: 10px;
}

.m2-btn,
.btn,
.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link,
.m2-platform-tab,
.m2-app-btn {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 13px;
}

.m2-metric {
  margin-top: 6px;
  font-size: 22px;
}

.m2-metric-card {
  min-height: 98px;
}

.m2-keys-header .m2-chip-row {
  gap: 6px;
}

@media (max-width: 900px) {
  .m2-masthead {
    position: static;
    top: auto;
  }

  .m2-masthead-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
  }

  .m2-main-nav,
  .m2-main-actions {
    justify-content: flex-start;
  }

  .m2-main-actions .m2-sidebar-logout {
    width: auto;
  }
}

@media (max-width: 640px) {
  .m2-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .m2-body select,
  .m2-body textarea,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea,
  .admin-input {
    font-size: 16px;
    line-height: 1.3;
  }

  .m2-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .m2-main-menu {
    width: 100%;
  }

  .js-m2-mobile-nav .m2-main-menu {
    display: none;
  }

  .js-m2-mobile-nav .m2-main-menu.is-open {
    display: grid;
    gap: 8px;
  }

  .m2-content-wrap {
    padding: 10px;
  }

  .m2-card,
  .card,
  .m2-topbar {
    padding: 10px;
  }

  .m2-topbar-title {
    font-size: 16px;
  }

  .m2-metric {
    font-size: 20px;
  }

  .m2-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.wc-toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  width: min(92vw, 380px);
  display: grid;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.wc-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--nv-border-strong);
  background: rgba(18, 22, 34, 0.96);
  color: var(--nv-text);
  box-shadow: var(--nv-shadow);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wc-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wc-toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.wc-toast-success {
  border-color: rgba(49, 208, 170, 0.55);
  background: rgba(16, 72, 60, 0.96);
}

.wc-toast-error {
  border-color: rgba(255, 95, 125, 0.55);
  background: rgba(72, 21, 36, 0.96);
}

.wc-toast-close {
  border: 0;
  background: transparent;
  color: var(--nv-muted);
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  min-height: auto;
  box-shadow: none;
}

.wc-toast-close:hover {
  color: var(--nv-text);
  transform: none;
  box-shadow: none;
}

.m2-card p,
.card p {
  margin: 0 0 10px;
}

.m2-card p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.m2-card .m2-actions,
.m2-card .m2-actions-wrap,
.m2-card .m2-chip-row,
.card .profile-menu {
  margin-top: 10px;
}

.m2-card .m2-btn,
.m2-card .btn,
.card .m2-btn,
.card .btn {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .m2-inline-form,
  .m2-actions-wrap,
  .admin-actions {
    width: 100%;
  }

  .m2-inline-form .m2-input,
  .m2-inline-form .m2-btn,
  .m2-actions-wrap .m2-btn,
  .admin-actions .m2-input,
  .admin-actions .m2-btn {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .m2-table.keys-table,
  .m2-table.keys-table thead,
  .m2-table.keys-table tbody,
  .m2-table.keys-table tr,
  .m2-table.keys-table td {
    display: block;
    width: 100%;
  }

  .m2-table.keys-table {
    min-width: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .m2-table.keys-table thead {
    display: none;
  }

  .m2-table.keys-table tr {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(121, 148, 229, 0.26);
    background: rgba(11, 18, 37, 0.9);
  }

  .m2-table.keys-table td {
    border: 0 !important;
    padding: 6px 0;
    white-space: normal;
    word-break: break-word;
  }

  .m2-table.keys-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #c3d5f8;
    margin-bottom: 2px;
    font-weight: 700;
  }
}

/* ===== DEFAULT TEMPLATE REDESIGN (neo v2 - fully new look) ===== */
.wc-neo-body {
  --neo-bg: #f5f7ff;
  --neo-bg-soft: #ffffff;
  --neo-ink: #1d2340;
  --neo-muted: #66719c;
  --neo-border: #dde4ff;
  --neo-border-strong: #c9d5ff;
  --neo-primary: #5a64ff;
  --neo-primary-2: #8b5dff;
  --neo-accent: #14b8ff;
  --neo-success: #17b37a;
  --neo-danger: #e44f7d;
  color: var(--neo-ink);
  background:
    radial-gradient(900px 520px at -8% -12%, rgba(90, 100, 255, 0.2), transparent 62%),
    radial-gradient(860px 500px at 108% -8%, rgba(20, 184, 255, 0.16), transparent 62%),
    linear-gradient(180deg, #f8f9ff 0%, #eef3ff 100%);
}

.wc-neo-body .wc-neo-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wc-neo-body .wc-neo-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.45;
}

.wc-neo-body .wc-neo-glow-a {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -100px;
  background: #8d93ff;
}

.wc-neo-body .wc-neo-glow-b {
  width: 380px;
  height: 380px;
  right: -110px;
  top: -80px;
  background: #60ddff;
}

.wc-neo-body .wc-neo-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(111, 128, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 128, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
  mask-image: radial-gradient(circle at 50% 25%, rgba(0, 0, 0, 0.62), transparent 85%);
}

.wc-neo-body .wc-neo-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.wc-neo-body .wc-neo-sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  border-radius: 24px;
  border: 1px solid var(--neo-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 248, 255, 0.92));
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 48px rgba(59, 71, 126, 0.16);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wc-neo-body .wc-neo-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wc-neo-body .wc-neo-brand {
  margin: 0;
  flex: 1;
  border: 0;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(90, 100, 255, 0.16), rgba(20, 184, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wc-neo-body .m2-brand-logo {
  border-radius: 12px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-primary-2));
  color: #fff;
}

.wc-neo-body .m2-brand-title {
  color: #1a2140;
  font-size: 15px;
}

.wc-neo-body .m2-brand-sub {
  color: #5b6792;
  font-size: 12px;
}

.wc-neo-body .wc-neo-sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--neo-border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: #3a456f;
}

.wc-neo-body .wc-neo-nav {
  display: grid;
  gap: 8px;
}

.wc-neo-body .wc-neo-nav-link,
.wc-neo-body .wc-neo-logout {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.88);
  color: #2b355f;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.wc-neo-body .wc-neo-nav-link::before,
.wc-neo-body .wc-neo-logout::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
  box-shadow: 0 0 0 4px rgba(120, 145, 255, 0.18);
}

.wc-neo-body .wc-neo-nav-link:hover,
.wc-neo-body .wc-neo-logout:hover {
  transform: translateX(3px);
  border-color: var(--neo-border-strong);
  background: linear-gradient(135deg, #ffffff, #f2f6ff);
  box-shadow: 0 12px 26px rgba(90, 109, 189, 0.16);
  color: #1f2852;
}

.wc-neo-body .wc-neo-nav-link.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-primary-2));
  box-shadow: 0 14px 30px rgba(88, 94, 233, 0.34);
}

.wc-neo-body .wc-neo-nav-link.is-active::before {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.24);
}

.wc-neo-body .wc-neo-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed #d7defd;
}

.wc-neo-body .wc-neo-sidebar-foot form {
  margin: 0;
}

.wc-neo-body .wc-neo-logout {
  justify-content: center;
  width: 100%;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #f05a8b, #d64273);
  box-shadow: 0 14px 24px rgba(228, 79, 125, 0.26);
}

.wc-neo-body .wc-neo-logout::before {
  display: none;
}

.wc-neo-body .wc-neo-main {
  min-width: 0;
  border-radius: 26px;
  border: 1px solid rgba(216, 225, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 60px rgba(70, 90, 170, 0.14);
  overflow: hidden;
}

.wc-neo-body .wc-neo-main-head {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5ebff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(248, 250, 255, 0.93));
}

.wc-neo-body .wc-neo-head-spacer {
  flex: 1;
}

.wc-neo-body .wc-neo-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--neo-border-strong);
  background: #fff;
  color: #38466d;
}

.wc-neo-body .wc-neo-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid #d7e1ff;
  background: #fff;
  color: #67739f;
  font-size: 12px;
  font-weight: 600;
}

.wc-neo-body .wc-neo-content-wrap {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 18px;
}

.wc-neo-body .m2-topbar,
.wc-neo-body .m2-card,
.wc-neo-body .card {
  border: 1px solid #e0e7ff;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(58, 74, 132, 0.08);
}

.wc-neo-body .m2-topbar {
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff, #f8faff);
}

.wc-neo-body .m2-topbar-title {
  color: #1f2952;
  font-size: clamp(20px, 2.2vw, 26px);
}

.wc-neo-body .m2-topbar-sub,
.wc-neo-body .m2-muted,
.wc-neo-body .muted,
.wc-neo-body .m2-field,
.wc-neo-body .m2-kicker {
  color: #6d78a3;
}

.wc-neo-body .m2-content {
  margin-top: 14px;
}

.wc-neo-body .m2-btn,
.wc-neo-body .btn,
.wc-neo-body .m2-platform-tab,
.wc-neo-body .m2-app-btn,
.wc-neo-body .top-link,
.wc-neo-body .m2-chip-link,
.wc-neo-body .m2-nav-link,
.wc-neo-body .m2-sidebar-logout {
  min-height: 42px;
  border-radius: 13px;
  border: 1px solid transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-primary-2));
  box-shadow: 0 14px 28px rgba(89, 103, 241, 0.24);
}

.wc-neo-body .m2-btn-ghost,
.wc-neo-body .btn-secondary {
  color: #3d4870;
  border-color: #dde5ff;
  background: #fff;
  box-shadow: none;
}

.wc-neo-body .m2-btn-danger,
.wc-neo-body .btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f05a8b, #d64273);
  box-shadow: 0 12px 24px rgba(228, 79, 125, 0.24);
}

.wc-neo-body .m2-input,
.wc-neo-body input,
.wc-neo-body select,
.wc-neo-body textarea,
.wc-neo-body .admin-input {
  border-radius: 13px;
  border: 1px solid #dce5ff;
  background: #fbfcff;
  color: #253055;
}

.wc-neo-body .m2-input:focus,
.wc-neo-body input:focus,
.wc-neo-body select:focus,
.wc-neo-body textarea:focus,
.wc-neo-body .admin-input:focus {
  border-color: #9db2ff;
  box-shadow: 0 0 0 4px rgba(117, 140, 255, 0.18);
  outline: none;
}

.wc-neo-body .m2-notice,
.wc-neo-body .notice {
  border-radius: 14px;
  border: 1px solid #d9e3ff;
  background: #f8faff;
}

.wc-neo-body .m2-success,
.wc-neo-body .notice.success {
  border-color: rgba(23, 179, 122, 0.3);
  background: rgba(23, 179, 122, 0.1);
}

.wc-neo-body .m2-error,
.wc-neo-body .notice.error {
  border-color: rgba(228, 79, 125, 0.34);
  background: rgba(228, 79, 125, 0.1);
}

.wc-neo-body .m2-table-wrap,
.wc-neo-body .table-container {
  border: 1px solid #e0e8ff;
  border-radius: 16px;
  background: #fff;
  overflow: auto;
}

.wc-neo-body .m2-table,
.wc-neo-body table,
.wc-neo-body .data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
}

.wc-neo-body .m2-table thead th,
.wc-neo-body thead th,
.wc-neo-body .data-table thead th {
  background: linear-gradient(135deg, rgba(90, 100, 255, 0.12), rgba(20, 184, 255, 0.1));
  color: #35406f;
  border-bottom: 1px solid #d7e2ff;
}

.wc-neo-body .m2-table td,
.wc-neo-body .m2-table th,
.wc-neo-body td,
.wc-neo-body th,
.wc-neo-body .data-table td,
.wc-neo-body .data-table th {
  border-bottom: 1px solid #e8edff;
  color: #2a345e;
}

.wc-neo-body .m2-table tbody tr:hover td,
.wc-neo-body tbody tr:hover td {
  background: #f8faff;
}

.wc-neo-body .m2-auth-layout {
  display: grid;
  grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.wc-neo-body .m2-auth-side,
.wc-neo-body .m2-auth-main {
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.wc-neo-body .wc-neo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27, 39, 86, 0.28);
  z-index: 65;
}

.wc-neo-body .wc-neo-overlay[hidden] {
  display: none !important;
}

.wc-neo-body.wc-neo-lock .wc-neo-overlay {
  display: block;
}

/* Neo v2: enforce light input surfaces and readable button labels */
.wc-neo-body .m2-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.wc-neo-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.wc-neo-body .m2-body select,
.wc-neo-body select,
.wc-neo-body .m2-body textarea,
.wc-neo-body textarea,
.wc-neo-body .admin-input {
  background: #fbfcff !important;
  color: #2f3c68 !important;
  border-color: #dce5ff !important;
}

.wc-neo-body .m2-btn,
.wc-neo-body .btn,
.wc-neo-body button,
.wc-neo-body input[type="submit"],
.wc-neo-body input[type="button"],
.wc-neo-body .m2-nav-link,
.wc-neo-body .m2-chip-link,
.wc-neo-body .top-link,
.wc-neo-body .m2-platform-tab,
.wc-neo-body .m2-app-btn {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(26, 34, 71, 0.35);
}

.wc-neo-body .m2-btn-ghost,
.wc-neo-body .btn-secondary,
.wc-neo-body .m2-btn-ghost:hover,
.wc-neo-body .btn-secondary:hover {
  color: #34406d !important;
  text-shadow: none;
}

@media (max-width: 980px) {
  .wc-neo-body.wc-neo-lock {
    overflow: hidden;
  }

  .wc-neo-body .wc-neo-app {
    display: block;
    padding: 10px;
  }

  .wc-neo-body .wc-neo-sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(320px, calc(100vw - 20px));
    height: auto;
    z-index: 70;
    transform: translateX(-110%);
    transition: transform 0.24s ease;
  }

  .wc-neo-body .wc-neo-sidebar.is-open {
    transform: translateX(0);
  }

  .wc-neo-body .wc-neo-sidebar-close,
  .wc-neo-body .wc-neo-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .wc-neo-body .wc-neo-main {
    border-radius: 20px;
  }

  .wc-neo-body .wc-neo-content-wrap {
    padding: 12px;
  }

  .wc-neo-body .m2-auth-layout,
  .wc-neo-body .m2-grid-2,
  .wc-neo-body .m2-grid-3,
  .wc-neo-body .grid.two {
    grid-template-columns: 1fr;
  }

  .wc-neo-body .m2-actions-wrap,
  .wc-neo-body .m2-inline-form,
  .wc-neo-body .admin-actions,
  .wc-neo-body .profile-menu {
    width: 100%;
  }

  .wc-neo-body .m2-actions-wrap > *,
  .wc-neo-body .m2-inline-form > *,
  .wc-neo-body .admin-actions > *,
  .wc-neo-body .profile-menu > * {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .wc-neo-body .wc-neo-main-head {
    min-height: 56px;
    padding: 8px 10px;
  }

  .wc-neo-body .wc-neo-badge {
    min-height: 27px;
    padding: 0 9px;
    font-size: 11px;
  }

  .wc-neo-body .m2-topbar,
  .wc-neo-body .m2-card,
  .wc-neo-body .card {
    border-radius: 14px;
    padding: 10px;
  }

  .wc-neo-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .wc-neo-body select,
  .wc-neo-body textarea,
  .wc-neo-body .admin-input {
    font-size: 16px;
    line-height: 1.3;
  }
}

@media (max-width: 760px) {
  .wc-neo-body .m2-table.keys-table tr {
    background: #ffffff !important;
    border: 1px solid #dbe5ff !important;
    box-shadow: 0 8px 18px rgba(73, 91, 160, 0.08);
  }

  .wc-neo-body .m2-table.keys-table td {
    color: #2c3762 !important;
    background: transparent !important;
  }

  .wc-neo-body .m2-table.keys-table td::before {
    color: #6676ac !important;
  }
}

/* Neo v2 final light lock: prevent legacy dark m2 layer from leaking */
body.wc-neo-body {
  color-scheme: light !important;
}

body.wc-neo-body,
body.wc-neo-body .m2-content,
body.wc-neo-body .m2-sidebar,
body.wc-neo-body .m2-masthead,
body.wc-neo-body .m2-topbar,
body.wc-neo-body .m2-card,
body.wc-neo-body .card,
body.wc-neo-body .inner,
body.wc-neo-body .m2-install-main,
body.wc-neo-body .m2-install-sidebar,
body.wc-neo-body .m2-auth-main,
body.wc-neo-body .m2-auth-side,
body.wc-neo-body .m2-app-card,
body.wc-neo-body .m2-tariff-item,
body.wc-neo-body .m2-table-wrap,
body.wc-neo-body .table-container,
body.wc-neo-body .m2-table,
body.wc-neo-body .data-table {
  color: #25305a !important;
  border-color: #dce5ff !important;
}

body.wc-neo-body .m2-sidebar,
body.wc-neo-body .m2-masthead,
body.wc-neo-body .m2-topbar,
body.wc-neo-body .m2-card,
body.wc-neo-body .card,
body.wc-neo-body .inner,
body.wc-neo-body .m2-install-main,
body.wc-neo-body .m2-install-sidebar,
body.wc-neo-body .m2-auth-main,
body.wc-neo-body .m2-auth-side,
body.wc-neo-body .m2-app-card,
body.wc-neo-body .m2-tariff-item,
body.wc-neo-body .m2-table-wrap,
body.wc-neo-body .table-container {
  background: #ffffff !important;
  box-shadow: 0 14px 32px rgba(62, 79, 151, 0.1) !important;
}

body.wc-neo-body .m2-input,
body.wc-neo-body input,
body.wc-neo-body select,
body.wc-neo-body textarea,
body.wc-neo-body .admin-input {
  background: #fbfcff !important;
  color: #1f2a53 !important;
  border-color: #dce5ff !important;
  -webkit-text-fill-color: #1f2a53 !important;
}

body.wc-neo-body .m2-input::placeholder,
body.wc-neo-body input::placeholder,
body.wc-neo-body textarea::placeholder {
  color: #7b87b3 !important;
}

body.wc-neo-body .m2-table thead th,
body.wc-neo-body .data-table thead th,
body.wc-neo-body .m2-table td,
body.wc-neo-body .m2-table th,
body.wc-neo-body .data-table td,
body.wc-neo-body .data-table th {
  color: #2a3662 !important;
}

body.wc-neo-body .wc-toast {
  border-color: #d7e1ff !important;
  background: #ffffff !important;
  color: #2a3662 !important;
  box-shadow: 0 12px 30px rgba(62, 79, 151, 0.16) !important;
}

body.wc-neo-body .wc-toast-success {
  border-color: rgba(23, 179, 122, 0.34) !important;
  background: rgba(23, 179, 122, 0.1) !important;
  color: #1f6e50 !important;
}

body.wc-neo-body .wc-toast-error {
  border-color: rgba(228, 79, 125, 0.36) !important;
  background: rgba(228, 79, 125, 0.1) !important;
  color: #8f3256 !important;
}

body.wc-neo-body .wc-toast-close {
  color: #5e6c9c !important;
}

/* Global breathing room: text and buttons should never stick together */
.m2-actions,
.m2-actions-wrap,
.m2-inline-form,
.admin-actions,
.profile-menu,
.m2-chip-row {
  gap: 12px;
}

.m2-content p + .m2-actions,
.m2-content p + .m2-actions-wrap,
.m2-content p + .m2-inline-form,
.m2-content p + .admin-actions,
.m2-content p + .profile-menu,
.m2-content ul + .m2-actions,
.m2-content ul + .m2-actions-wrap,
.m2-content ul + .m2-inline-form,
.m2-content ul + .admin-actions,
.m2-content ul + .profile-menu,
.m2-content ol + .m2-actions,
.m2-content ol + .m2-actions-wrap,
.m2-content ol + .m2-inline-form,
.m2-content ol + .admin-actions,
.m2-content ol + .profile-menu,
.m2-content .m2-notice + .m2-actions,
.m2-content .m2-notice + .m2-actions-wrap,
.m2-content .notice + .m2-actions,
.m2-content .notice + .m2-actions-wrap,
.m2-content .m2-props + .m2-actions,
.m2-content .m2-props + .m2-actions-wrap {
  margin-top: 12px;
}

.m2-content p + .m2-btn,
.m2-content p + .btn,
.m2-content ul + .m2-btn,
.m2-content ul + .btn,
.m2-content ol + .m2-btn,
.m2-content ol + .btn,
.m2-content .notice + .m2-btn,
.m2-content .notice + .btn,
.m2-content .m2-notice + .m2-btn,
.m2-content .m2-notice + .btn {
  margin-top: 12px;
}

body.wc-neo-body .m2-actions,
body.wc-neo-body .m2-actions-wrap,
body.wc-neo-body .m2-inline-form,
body.wc-neo-body .admin-actions,
body.wc-neo-body .profile-menu,
body.wc-neo-body .m2-chip-row {
  gap: 14px;
}

body.wc-neo-body .m2-card .m2-actions,
body.wc-neo-body .m2-card .m2-actions-wrap,
body.wc-neo-body .m2-card .m2-inline-form,
body.wc-neo-body .m2-card .admin-actions,
body.wc-neo-body .m2-card .profile-menu,
body.wc-neo-body .card .m2-actions,
body.wc-neo-body .card .m2-actions-wrap,
body.wc-neo-body .card .m2-inline-form,
body.wc-neo-body .card .admin-actions,
body.wc-neo-body .card .profile-menu {
  margin-top: 14px;
}

body.wc-neo-body .m2-content p + .m2-btn,
body.wc-neo-body .m2-content p + .btn,
body.wc-neo-body .m2-content ul + .m2-btn,
body.wc-neo-body .m2-content ul + .btn,
body.wc-neo-body .m2-content ol + .m2-btn,
body.wc-neo-body .m2-content ol + .btn,
body.wc-neo-body .m2-content .notice + .m2-btn,
body.wc-neo-body .m2-content .notice + .btn,
body.wc-neo-body .m2-content .m2-notice + .m2-btn,
body.wc-neo-body .m2-content .m2-notice + .btn {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .m2-actions,
  .m2-actions-wrap,
  .m2-inline-form,
  .admin-actions,
  .profile-menu,
  .m2-chip-row,
  body.wc-neo-body .m2-actions,
  body.wc-neo-body .m2-actions-wrap,
  body.wc-neo-body .m2-inline-form,
  body.wc-neo-body .admin-actions,
  body.wc-neo-body .profile-menu,
  body.wc-neo-body .m2-chip-row {
    gap: 10px;
  }

  .m2-content p + .m2-btn,
  .m2-content p + .btn,
  .m2-content ul + .m2-btn,
  .m2-content ul + .btn,
  .m2-content ol + .m2-btn,
  .m2-content ol + .btn,
  body.wc-neo-body .m2-content p + .m2-btn,
  body.wc-neo-body .m2-content p + .btn,
  body.wc-neo-body .m2-content ul + .m2-btn,
  body.wc-neo-body .m2-content ul + .btn,
  body.wc-neo-body .m2-content ol + .m2-btn,
  body.wc-neo-body .m2-content ol + .btn {
    margin-top: 10px;
  }
}

/* Targeted spacing fixes: admin "Группа" and keys connection actions */
.m2-chip-row + .m2-form-grid {
  margin-top: 14px;
}

.m2-row-between + .m2-install-top-actions,
.m2-card h2 + .m2-install-top-actions {
  margin-top: 14px;
}

.m2-form-grid > .m2-btn,
.m2-form-grid > .btn,
.m2-form-grid > button,
.m2-form-grid > .m2-actions,
.m2-form-grid > .m2-actions-wrap,
.m2-form-grid > .m2-inline-form,
.m2-form-grid > .admin-actions,
.m2-form-grid > .profile-menu {
  margin-top: 8px;
}

.m2-field > span {
  line-height: 1.35;
  margin-bottom: 2px;
}

body.wc-neo-body .m2-chip-row + .m2-form-grid {
  margin-top: 16px;
}

body.wc-neo-body .m2-row-between + .m2-install-top-actions,
body.wc-neo-body .m2-card h2 + .m2-install-top-actions {
  margin-top: 16px;
}

body.wc-neo-body .m2-form-grid > .m2-btn,
body.wc-neo-body .m2-form-grid > .btn,
body.wc-neo-body .m2-form-grid > button,
body.wc-neo-body .m2-form-grid > .m2-actions,
body.wc-neo-body .m2-form-grid > .m2-actions-wrap,
body.wc-neo-body .m2-form-grid > .m2-inline-form,
body.wc-neo-body .m2-form-grid > .admin-actions,
body.wc-neo-body .m2-form-grid > .profile-menu {
  margin-top: 10px;
}

body.wc-neo-body .m2-field > span {
  margin-bottom: 4px;
}
