: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;
  }
}

/* ===== SOLO SIDEBAR LAYOUT (admin-panel structure) ===== */
.solo-layout {
  display: block;
  min-height: 100vh;
}

.solo-layout .content {
  margin-left: 272px;
  padding: clamp(1rem, 2vw, 1.5rem);
  min-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.solo-layout .content-shell {
  width: 100%;
  max-width: var(--solo-page-width, 1160px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding-bottom: 1.25rem;
}

.solo-layout .m2-content-wrap {
  width: 100%;
  max-width: var(--solo-page-width, 1160px);
  margin: 0 auto;
}

.solo-layout .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  height: 100dvh;
  background: linear-gradient(180deg, #121a34, #0f1730);
  border-right: 1px solid var(--solo-border-light);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.35);
  z-index: 70;
}

.solo-layout .sidebar-inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.85rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.solo-layout .sidebar-close {
  display: none;
}

.solo-layout .sidebar-header {
  margin-bottom: 0.2rem;
}

.solo-layout .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.solo-layout .sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--solo-border-light);
  border-radius: 16px;
  background: rgba(18, 28, 56, 0.55);
}

.solo-layout .sidebar-section-title {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--solo-text-tertiary);
  margin: 0.25rem 0 0.25rem 0.5rem;
}

.solo-layout .sidebar-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.solo-layout .sidebar-btn {
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none;
  padding: 0.55rem 0.9rem 0.55rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 38px;
  background: var(--solo-card);
  color: var(--solo-text-primary);
  border: 1px solid var(--solo-border);
  box-shadow: var(--solo-shadow-1);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.solo-layout .sidebar-btn:not(.active):hover {
  background: var(--solo-hover);
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 45%, var(--solo-border));
  color: var(--solo-text-primary);
  box-shadow: var(--solo-shadow-2);
}

.solo-layout .sidebar-btn.active {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  color: #081426;
  border: none;
  box-shadow: var(--solo-accent-shadow);
}

.solo-layout .sidebar-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.solo-layout .sidebar-footer {
  padding: 0.8rem;
  border-top: 1px solid var(--solo-border-light);
}

.solo-layout .sidebar-footer form {
  margin: 0;
}

.solo-layout .header-bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 0.15rem;
}

.solo-layout .burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--solo-border);
  background: var(--solo-card);
  color: var(--solo-text-primary);
  box-shadow: var(--solo-shadow-1);
  cursor: pointer;
}

.solo-layout .flex-1 {
  flex: 1;
}

.solo-layout .sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 24, 0.6);
  z-index: 68;
}

@media (max-width: 900px) {
  .solo-layout .content {
    margin-left: 0;
    padding: 0.7rem;
  }

  .solo-layout .burger,
  .solo-layout .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .solo-layout .sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    margin-left: auto;
  }

  .solo-layout .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .solo-layout .sidebar.is-open {
    transform: translateX(0);
  }

  .solo-layout .sidebar-section {
    padding: 0.5rem;
  }

  .solo-layout .sidebar-btn {
    min-height: 36px;
    font-size: 0.88rem;
  }
}

/* ===== SOLO CONTRAST HOTFIX ===== */
.solo-layout .sidebar-section-title,
.m2-brand-sub,
.m2-muted,
.m2-topbar-sub,
.m2-field,
.card .muted,
.notice,
.m2-notice {
  color: #d6e2ff;
}

.m2-topbar {
  background: linear-gradient(135deg, #2cb5e8, #1f8ed8);
}

.m2-topbar-title,
.m2-topbar-sub {
  color: #f6fbff;
}

.m2-btn,
.btn,
button,
input[type="submit"],
input[type="button"] {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(3, 8, 20, 0.45);
}

.m2-btn:hover,
.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  color: #ffffff;
}

.m2-btn-ghost,
.btn-secondary,
.solo-layout .sidebar-btn,
.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link {
  color: #eef4ff;
}

.m2-btn-ghost:hover,
.btn-secondary:hover,
.solo-layout .sidebar-btn:not(.active):hover,
.m2-nav-link:hover,
.m2-sidebar-logout:hover,
.m2-chip-link:hover {
  color: #ffffff;
}

.solo-layout .sidebar-btn.active,
.m2-nav-link.is-active,
.m2-chip-link.is-active {
  color: #ffffff;
}

.m2-card,
.card,
.m2-table-wrap,
.table-container,
.m2-auth-side,
.m2-auth-main {
  color: #ecf3ff;
}

.m2-card a,
.card a,
.m2-content a {
  color: #7fd7ff;
}

.m2-card a:hover,
.card a:hover,
.m2-content a:hover {
  color: #b1e8ff;
}

.m2-table thead th,
thead th,
.data-table thead th {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(4, 9, 20, 0.45);
}

@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-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;
  }
}

/* ===== 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-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;
  }
}

.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;
}

/* ===== SOLO THEME REDESIGN (web_admin_panel-inspired, custom palette) ===== */
:root {
  --solo-bg-primary: #080c18;
  --solo-bg-secondary: #10172b;
  --solo-bg-tertiary: #17213a;
  --solo-text-primary: #f4f7ff;
  --solo-text-secondary: #b8c4e5;
  --solo-text-tertiary: #8f9fc6;
  --solo-border: #2a3860;
  --solo-border-light: rgba(184, 201, 246, 0.18);
  --solo-accent-primary: #7b6bff;
  --solo-accent-secondary: #4ca2ff;
  --solo-accent-soft: rgba(123, 107, 255, 0.2);
  --solo-hover: #1a2746;
  --solo-card: #131d35;
  --solo-input: #0f182f;
  --solo-shadow-1: 0 10px 24px rgba(2, 6, 18, 0.4);
  --solo-shadow-2: 0 16px 34px rgba(2, 6, 18, 0.52);
  --solo-accent-shadow: 0 10px 24px rgba(76, 162, 255, 0.3);
  --solo-page-width: 1160px;
  --solo-danger-a: #ff6e8f;
  --solo-danger-b: #d94b74;
  --solo-success-a: #44d6a8;
  --solo-success-b: #31b98f;
}

.m2-body,
body {
  background:
    radial-gradient(120% 110% at 10% 0%, rgba(123, 107, 255, 0.2), transparent 48%),
    radial-gradient(110% 120% at 90% 0%, rgba(76, 162, 255, 0.18), transparent 50%),
    linear-gradient(160deg, #070b16, #0b1224 46%, #0a1122 100%);
  color: var(--solo-text-primary);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.m2-content-wrap {
  padding: 18px;
}

.m2-masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 14, 29, 0.86);
  border-bottom: 1px solid var(--solo-border-light);
  backdrop-filter: blur(12px);
  box-shadow: var(--solo-shadow-1);
}

.m2-masthead-row {
  min-height: 72px;
}

.m2-brand {
  border: 1px solid var(--solo-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: 8px 12px;
}

.m2-brand-logo {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  color: #081426;
}

.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link {
  background: var(--solo-card);
  color: var(--solo-text-primary);
  border: 1px solid var(--solo-border);
  border-radius: 12px;
  box-shadow: var(--solo-shadow-1);
}

.m2-nav-link:hover,
.m2-sidebar-logout:hover,
.m2-chip-link:hover {
  background: var(--solo-hover);
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 45%, var(--solo-border));
}

.m2-nav-link.is-active,
.m2-chip-link.is-active {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  color: #081426;
  border-color: transparent;
  box-shadow: var(--solo-accent-shadow);
}

.m2-topbar {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  border: 0;
  border-radius: 14px;
  box-shadow: var(--solo-accent-shadow);
  color: #081426;
}

.m2-topbar-title,
.m2-topbar-sub {
  color: #081426;
}

.m2-topbar-sub {
  opacity: 0.82;
}

.m2-content {
  margin-top: 12px;
}

.m2-card,
.card {
  background: linear-gradient(180deg, rgba(20, 29, 57, 0.94), rgba(17, 25, 49, 0.96));
  border: 1px solid var(--solo-border);
  border-radius: 14px;
  box-shadow: var(--solo-shadow-2);
}

.m2-card h1,
.m2-card h2,
.m2-card h3,
.card h1,
.card h2,
.card h3 {
  color: var(--solo-text-primary);
}

.m2-muted,
.muted,
.m2-topbar-sub,
.m2-brand-sub,
.m2-field {
  color: var(--solo-text-secondary);
}

.m2-kpi-pill,
.m2-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--solo-border-light);
  color: var(--solo-text-secondary);
}

.m2-btn,
.btn,
button {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  color: #081426;
  border: 0;
  box-shadow: var(--solo-accent-shadow);
  font-weight: 700;
}

.m2-btn:hover,
.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(76, 162, 255, 0.36);
}

.m2-btn-ghost,
.btn-secondary {
  background: var(--solo-bg-tertiary);
  color: var(--solo-text-primary);
  border: 1px solid var(--solo-border);
  box-shadow: var(--solo-shadow-1);
}

.m2-btn-danger,
.btn-danger {
  background: linear-gradient(135deg, var(--solo-danger-a), var(--solo-danger-b));
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 107, 143, 0.3);
}

.m2-input,
.m2-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.m2-body select,
.m2-body textarea,
input,
select,
textarea,
.admin-input {
  background: var(--solo-input);
  border: 1px solid var(--solo-border);
  color: var(--solo-text-primary);
  border-radius: 11px;
}

.m2-input:focus,
.m2-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.m2-body select:focus,
.m2-body textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 60%, #ffffff 20%);
  box-shadow: 0 0 0 3px var(--solo-accent-soft);
}

.m2-notice,
.notice,
.app-notice {
  border-radius: 12px;
  border: 1px solid var(--solo-border);
  background: var(--solo-bg-secondary);
  color: var(--solo-text-primary);
  box-shadow: var(--solo-shadow-1);
}

.m2-success,
.notice.success,
.app-notice-success {
  background: rgba(68, 214, 168, 0.14);
  border-color: rgba(68, 214, 168, 0.52);
}

.m2-error,
.notice.error,
.app-notice-error {
  background: rgba(239, 71, 111, 0.16);
  border-color: rgba(239, 71, 111, 0.52);
}

.m2-table-wrap,
.table-container {
  background: var(--solo-bg-secondary);
  border: 1px solid var(--solo-border);
  border-radius: 14px;
  box-shadow: var(--solo-shadow-1);
  padding: 10px;
}

.m2-table,
table,
.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.m2-table thead th,
thead th,
.data-table thead th {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary));
  color: #081426;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  border-bottom: 0;
}

.m2-table td,
.m2-table th,
td,
th,
.data-table td,
.data-table th {
  border-bottom: 1px solid var(--solo-border-light);
  color: var(--solo-text-primary);
}

.m2-table tbody tr,
tbody tr,
.data-table tbody tr {
  background: var(--solo-card);
}

.m2-table tbody tr:nth-child(2n),
tbody tr:nth-child(2n),
.data-table tbody tr:nth-child(2n) {
  background: var(--solo-bg-secondary);
}

.m2-table tbody tr:hover,
tbody tr:hover,
.data-table tbody tr:hover {
  background: var(--solo-hover);
}

.m2-auth-layout {
  gap: 16px;
}

.m2-auth-side,
.m2-auth-main {
  background: linear-gradient(180deg, rgba(22, 33, 66, 0.95), rgba(16, 24, 48, 0.96));
  border: 1px solid var(--solo-border);
  box-shadow: var(--solo-shadow-2);
}

.wc-toast {
  background: rgba(13, 21, 43, 0.97);
  border: 1px solid var(--solo-border);
  color: var(--solo-text-primary);
}

.wc-toast-success {
  border-color: rgba(68, 214, 168, 0.56);
  background: rgba(13, 59, 47, 0.95);
}

.wc-toast-error {
  border-color: rgba(239, 71, 111, 0.58);
  background: rgba(72, 20, 36, 0.95);
}

@media (max-width: 900px) {
  .m2-content-wrap {
    padding: 12px;
  }

  .m2-topbar,
  .m2-card,
  .card {
    border-radius: 12px;
    padding: 12px;
  }

  .m2-auth-layout,
  .m2-dashboard-hero-grid,
  .m2-payments-top-grid,
  .m2-keys-header {
    grid-template-columns: 1fr;
  }

  .m2-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .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;
  }
}

/* Final readability guard (text only; keep existing block colors) */
.m2-body,
.m2-content,
.m2-card,
.card,
.m2-auth-main,
.m2-auth-side,
.m2-table,
.data-table {
  color: #edf4ff;
}

.m2-topbar,
.m2-topbar-title,
.m2-topbar-sub,
.m2-topbar .m2-topbar-title,
.m2-topbar .m2-topbar-sub {
  color: #f7fbff !important;
  text-shadow: 0 1px 2px rgba(2, 8, 20, 0.55);
}

.m2-topbar-sub,
.m2-topbar .m2-topbar-sub,
.m2-muted,
.muted,
.m2-field,
.m2-brand-sub,
.sidebar-section-title,
.m2-kicker,
.m2-kpi-pill,
.m2-chip {
  color: #dce8ff !important;
  opacity: 1 !important;
}

.m2-btn,
.btn,
button,
input[type="submit"],
input[type="button"],
.m2-nav-link,
.m2-sidebar-logout,
.m2-chip-link,
.solo-layout .sidebar-btn {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(3, 8, 20, 0.48);
}

.m2-btn-ghost,
.btn-secondary,
.m2-btn-danger,
.btn-danger,
.solo-layout .sidebar-btn.active,
.m2-nav-link.is-active,
.m2-chip-link.is-active {
  color: #ffffff !important;
}

.m2-content a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link),
.m2-card a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link),
.card a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link) {
  color: #9edfff !important;
}

.m2-content a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link):hover,
.m2-card a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link):hover,
.card a:not(.m2-btn):not(.btn):not(.m2-nav-link):not(.m2-chip-link):hover {
  color: #c5ecff !important;
}

.m2-table thead th,
thead th,
.data-table thead th,
.m2-table td,
.m2-table th,
.data-table td,
.data-table th,
td,
th {
  color: #f2f7ff !important;
}

/* Final overlap guard (buttons must not collide with text above) */
.m2-card,
.card,
.m2-auth-main,
.m2-auth-side {
  display: block;
}

.m2-card h1,
.m2-card h2,
.m2-card h3,
.m2-card p,
.card h1,
.card h2,
.card h3,
.card p {
  margin-bottom: 12px !important;
}

.m2-card .m2-actions,
.m2-card .m2-actions-wrap,
.m2-card .m2-inline-form,
.m2-card .m2-chip-row,
.card .profile-menu,
.card .m2-actions,
.card .m2-actions-wrap,
.card .m2-inline-form {
  margin-top: 14px !important;
  clear: both;
  align-items: center;
  row-gap: 10px;
}

.m2-card .m2-btn,
.m2-card .btn,
.card .m2-btn,
.card .btn,
.m2-inline-form .m2-btn,
.m2-actions-wrap .m2-btn,
.profile-menu .m2-chip-link {
  margin-top: 0 !important;
  position: relative;
  float: none;
}

.m2-hero-card {
  align-items: flex-start;
}

.m2-hero-card > * {
  position: relative;
  z-index: 1;
}

.m2-hero-card::after {
  z-index: 0;
}

@media (max-width: 900px) {
  .m2-card h1,
  .m2-card h2,
  .m2-card h3,
  .m2-card p,
  .card h1,
  .card h2,
  .card h3,
  .card p {
    margin-bottom: 10px !important;
  }

  .m2-card .m2-actions,
  .m2-card .m2-actions-wrap,
  .m2-card .m2-inline-form,
  .m2-card .m2-chip-row,
  .card .profile-menu,
  .card .m2-actions,
  .card .m2-actions-wrap,
  .card .m2-inline-form {
    margin-top: 12px !important;
  }
}

/* Solo: softer palette for tariffs editor */
.solo-tariffs-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--solo-card) 86%, #0a0f1f 14%), color-mix(in srgb, var(--solo-bg-secondary) 88%, #0a0f1f 12%));
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 26%, var(--solo-border));
}

.solo-tariffs-wrap {
  background: color-mix(in srgb, var(--solo-bg-secondary) 90%, #090f1c 10%);
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 24%, var(--solo-border));
}

.solo-tariffs-table {
  border-radius: 12px;
  overflow: hidden;
}

.solo-tariffs-table thead th {
  background: linear-gradient(135deg, color-mix(in srgb, var(--solo-accent-primary) 70%, #27345c 30%), color-mix(in srgb, var(--solo-accent-secondary) 65%, #213a61 35%)) !important;
  color: #f3f7ff !important;
  border-bottom: 1px solid color-mix(in srgb, var(--solo-accent-secondary) 38%, var(--solo-border)) !important;
}

.solo-tariffs-table tbody tr {
  background: color-mix(in srgb, var(--solo-card) 92%, #0b1222 8%) !important;
}

.solo-tariffs-table tbody tr:nth-child(2n) {
  background: color-mix(in srgb, var(--solo-bg-secondary) 90%, #0b1120 10%) !important;
}

.solo-tariffs-table tbody tr:hover {
  background: color-mix(in srgb, var(--solo-hover) 88%, #10203a 12%) !important;
}

.solo-tariffs-table td,
.solo-tariffs-table th {
  border-bottom: 1px solid color-mix(in srgb, var(--solo-accent-secondary) 20%, var(--solo-border)) !important;
  color: #e6eeff !important;
}

.solo-tariffs-table .m2-input {
  background: color-mix(in srgb, var(--solo-input) 94%, #0a1120 6%);
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 36%, var(--solo-border));
  color: #eef4ff;
}

.solo-tariffs-table .m2-input:focus {
  border-color: color-mix(in srgb, var(--solo-accent-secondary) 66%, #ffffff 14%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--solo-accent-secondary) 24%, transparent);
}

.solo-tariffs-table .m2-btn {
  background: linear-gradient(135deg, var(--solo-accent-primary), var(--solo-accent-secondary)) !important;
  color: #f7fbff !important;
  box-shadow: var(--solo-accent-shadow);
}

.solo-admin-page .m2-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.solo-admin-page .m2-chip-row .m2-chip-link {
  width: 100%;
}

.solo-admin-page .m2-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.solo-admin-page .admin-table {
  min-width: 940px;
}

.solo-admin-page .m2-inline-form,
.solo-admin-page .m2-actions-wrap {
  align-items: center;
}

@media (max-width: 900px) {
  .solo-layout .m2-content-wrap {
    max-width: 100%;
  }

  .solo-admin-page .m2-row-between {
    flex-direction: column;
    align-items: stretch;
  }

  .solo-admin-page .m2-row-between .m2-btn {
    width: 100%;
  }

  .solo-admin-page .m2-form-grid,
  .solo-admin-page .m2-inline-form,
  .solo-admin-page .m2-actions-wrap {
    width: 100%;
  }

  .solo-admin-page .m2-inline-form > *,
  .solo-admin-page .m2-actions-wrap > *,
  .solo-admin-page .m2-actions-wrap > form,
  .solo-admin-page .m2-actions-wrap > a {
    width: 100%;
  }

  .solo-admin-page .m2-inline-form .m2-input,
  .solo-admin-page .m2-inline-form .m2-btn,
  .solo-admin-page .m2-actions-wrap .m2-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .solo-admin-page .m2-chip-row {
    grid-template-columns: 1fr;
  }

  .solo-admin-page .admin-table {
    min-width: 760px;
  }
}
