:root {
  --bg: #080b11;
  --bg-soft: #0c1018;
  --surface: #111722;
  --surface-2: #161e2b;
  --surface-3: #1c2637;
  --border: #222c3d;
  --border-hover: #33415a;
  --text: #edf2f9;
  --text-secondary: #9aa6b9;
  --text-muted: #6d788b;
  --primary: #4f8cff;
  --primary-hover: #679dff;
  --primary-soft: rgba(79, 140, 255, 0.12);
  --success: #2db67a;
  --success-soft: rgba(45, 182, 122, 0.12);
  --danger: #df5261;
  --danger-soft: rgba(223, 82, 97, 0.12);
  --warning: #d59a38;
  --warning-soft: rgba(213, 154, 56, 0.12);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  --radius: 16px;
  --radius-small: 10px;
  --sidebar-width: 250px;
  --header-height: 70px;
}

[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #e9eef6;
  --border: #dce3ee;
  --border-hover: #bdc9da;
  --text: #172033;
  --text-secondary: #657187;
  --text-muted: #8a95a6;
  --primary-soft: rgba(79, 140, 255, 0.1);
  --success-soft: rgba(45, 182, 122, 0.1);
  --danger-soft: rgba(223, 82, 97, 0.1);
  --warning-soft: rgba(213, 154, 56, 0.1);
  --shadow: 0 18px 45px rgba(35, 49, 75, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -10%, rgba(79, 140, 255, 0.11), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(119, 77, 255, 0.07), transparent 25%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 5px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
}

/* Header */

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(102, 151, 255, 0.2);
  border-radius: 12px;
  color: #dce8ff;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.28), rgba(112, 77, 255, 0.13));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.brand-logo svg {
  width: 21px;
  height: 21px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  display: inline-grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-secondary);
  background: var(--surface);
  transition: 0.2s ease;
}

.icon-button:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface-2);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.mobile-menu-button {
  display: none;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-secondary);
  background: var(--surface);
}

.balance-chip strong {
  color: var(--text);
}

/* Sidebar */

.sidebar {
  position: fixed;
  z-index: 30;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-3);
}

.avatar-large {
  width: 82px;
  height: 82px;
  border: 3px solid rgba(79, 140, 255, 0.22);
  border-radius: 25px;
}

.sidebar-account-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-account-copy strong,
.sidebar-account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy span {
  color: var(--text-muted);
  font-size: 11px;
}

.navigation {
  overflow-y: auto;
  flex: 1;
  padding-right: 3px;
}

.navigation-label {
  padding: 0 10px;
  margin: 18px 0 8px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.navigation-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 600;
  text-align: left;
  transition: 0.2s ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-item.active {
  border-color: rgba(79, 140, 255, 0.16);
  color: #e8f0ff;
  background: var(--primary-soft);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.nav-item.active svg {
  color: #75a6ff;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 11px rgba(45, 182, 122, 0.55);
}

.server-status div {
  display: flex;
  flex-direction: column;
}

.server-status strong {
  font-size: 12px;
}

.server-status small {
  color: var(--text-muted);
  font-size: 10px;
}

.mobile-overlay {
  display: none;
}

/* Main */

.main-content {
  min-height: 100vh;
  padding: calc(var(--header-height) + 28px) 28px 36px;
  margin-left: var(--sidebar-width);
}

.page {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
}

.page.active {
  display: block;
  animation: page-in 0.2s ease;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

.page-heading p {
  max-width: 660px;
}

.eyebrow {
  margin-bottom: 6px;
  color: #71a2ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* Cards */

.card {
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), var(--bg-soft));
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.card-header p {
  font-size: 12px;
}

/* Profile */

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.profile-avatar-wrap {
  position: relative;
}

.online-badge {
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 17px;
  height: 17px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
}

.profile-main {
  min-width: 0;
}

.profile-main h2 {
  margin: 7px 0 1px;
  font-size: 23px;
}

.profile-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(79, 140, 255, 0.18);
  border-radius: 999px;
  color: #8ab5ff;
  background: var(--primary-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-success {
  border-color: rgba(45, 182, 122, 0.2);
  color: #68dba5;
  background: var(--success-soft);
}

.status-warning {
  border-color: rgba(213, 154, 56, 0.2);
  color: #ebbd6b;
  background: var(--warning-soft);
}

.status-danger {
  border-color: rgba(223, 82, 97, 0.2);
  color: #ff909a;
  background: var(--danger-soft);
}

.profile-balance {
  display: flex;
  min-width: 145px;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.profile-balance > span {
  color: var(--text-muted);
  font-size: 11px;
}

.profile-balance strong {
  margin: 2px 0;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.text-button {
  padding: 0;
  color: #79a7ff;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.details-list {
  margin: 0;
}

.details-list > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

.details-list > div:last-child {
  border-bottom: 0;
}

.details-list dt {
  color: var(--text-muted);
  font-size: 12px;
}

.details-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #7ba8ff;
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 700;
}

.inline-button svg {
  width: 13px;
  height: 13px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.action-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
  transition: 0.2s ease;
}

.action-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.action-card > span:last-child {
  display: flex;
  flex-direction: column;
}

.action-card small {
  color: var(--text-muted);
  font-size: 10px;
}

.action-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

.action-icon svg {
  width: 19px;
  height: 19px;
}

.action-primary .action-icon {
  color: #81adff;
  background: var(--primary-soft);
}

.action-success .action-icon {
  color: #64d8a3;
  background: var(--success-soft);
}

.action-secondary .action-icon {
  color: #b494ff;
  background: rgba(150, 105, 255, 0.12);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 13px;
}

.status-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #6bd9a5;
  background: var(--success-soft);
}

.status-card-icon svg {
  width: 21px;
  height: 21px;
}

.status-card > div:nth-child(2) {
  flex: 1;
}

.status-card h3 {
  margin-bottom: 2px;
}

/* Buttons */

.primary-button,
.secondary-button,
.success-button,
.danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  transition: 0.2s ease;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.2);
}

.secondary-button {
  border-color: var(--border);
  color: var(--text-secondary);
  background: var(--surface-2);
}

.secondary-button:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.success-button {
  color: #fff;
  background: var(--success);
}

.success-button:hover {
  box-shadow: 0 8px 20px rgba(45, 182, 122, 0.18);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.danger-button:hover {
  box-shadow: 0 8px 20px rgba(223, 82, 97, 0.18);
}

.button-full {
  width: 100%;
}

.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 15px;
}

/* Shop */

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tariff-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.tariff-card:hover {
  border-color: rgba(79, 140, 255, 0.35);
  transform: translateY(-3px);
}

.tariff-card.popular {
  border-color: rgba(79, 140, 255, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(79, 140, 255, 0.18), transparent 42%),
    var(--surface);
}

.tariff-popular {
  position: absolute;
  top: 12px;
  right: -28px;
  width: 100px;
  padding: 3px 0;
  color: #fff;
  background: var(--primary);
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(38deg);
}

.tariff-days {
  color: var(--text-muted);
  font-size: 11px;
}

.tariff-card h3 {
  margin: 6px 0 12px;
  font-size: 20px;
}

.tariff-price {
  margin-bottom: 4px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.tariff-price span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.tariff-card p {
  min-height: 34px;
  margin-bottom: 14px;
  font-size: 11px;
}

.tariff-card button {
  width: 100%;
}

.order-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.order-detail {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.order-detail span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.order-detail strong {
  font-size: 13px;
}

/* Lists */

.product-list {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  color: #83b0ff;
  background: var(--primary-soft);
}

.product-icon svg {
  width: 22px;
  height: 22px;
}

.product-info {
  min-width: 0;
}

.product-info h3 {
  margin-bottom: 3px;
}

.product-info p {
  font-size: 11px;
}

.product-key {
  margin-top: 9px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.product-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.product-actions button {
  min-height: 33px;
  padding: 6px 10px;
  font-size: 10px;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
}

th {
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.table-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: #e4b55f;
  background: var(--warning-soft);
  font-size: 9px;
  font-weight: 700;
}

.table-status.done {
  color: #64d9a3;
  background: var(--success-soft);
}

.table-status.rejected,
.table-status.cancelled {
  color: #ff8c97;
  background: var(--danger-soft);
}

/* Forms */

.narrow-card {
  max-width: 560px;
}

.activation-illustration {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 17px;
  color: #83b0ff;
  background: var(--primary-soft);
}

.activation-illustration svg {
  width: 28px;
  height: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 13px;
}

.field label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--bg-soft);
  transition: 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field input::placeholder {
  color: var(--text-muted);
}

.field small {
  color: var(--text-muted);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full-width {
  grid-column: 1 / -1;
}

/* Info */

.partner-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background:
    radial-gradient(circle at 90% 0, rgba(79, 140, 255, 0.14), transparent 35%),
    var(--surface);
}

.partner-icon,
.support-icon {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 19px;
  color: #84b1ff;
  background: var(--primary-soft);
}

.partner-icon svg,
.support-icon svg {
  width: 28px;
  height: 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.info-card {
  min-height: 190px;
}

.info-number {
  display: block;
  margin-bottom: 20px;
  color: #71a2ff;
  font-size: 12px;
  font-weight: 800;
}

.support-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  transition: 0.2s ease;
}

.document-item:hover {
  border-color: var(--border-hover);
}

.document-item > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 9px;
  color: #80adff;
  background: var(--primary-soft);
}

.document-item svg {
  width: 17px;
  height: 17px;
}

.document-item .arrow {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

/* Admin */

.admin-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.admin-tab {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-tab.active {
  color: #e8f0ff;
  background: var(--primary-soft);
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: page-in 0.2s ease;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 16px;
}

.admin-metric {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.admin-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.admin-metric strong {
  font-size: 23px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.code-output {
  max-height: 380px;
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 14px 0 0;
  color: #b7c5da;
  background: var(--bg);
  font: 11px/1.6 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Modal */

.modal,
.secret-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.open,
.secret-modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.74);
  backdrop-filter: blur(5px);
}

.modal-dialog,
.secret-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: 85vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.modal-body {
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.secret-dialog {
  width: min(100%, 390px);
  text-align: center;
}

.secret-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 18px;
  color: #82b0ff;
  background: var(--primary-soft);
}

.secret-icon svg {
  width: 27px;
  height: 27px;
}

.secret-value {
  padding: 15px;
  margin: 18px 0 12px;
  border: 1px solid rgba(79, 140, 255, 0.25);
  border-radius: 11px;
  color: #dce8ff;
  background: var(--primary-soft);
  font: 700 17px/1.5 "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
}

.secret-timer {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

/* Toast */

.toast-container {
  position: fixed;
  z-index: 120;
  top: calc(var(--header-height) + 12px);
  right: 18px;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 9px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}

.toast.success {
  border-color: rgba(45, 182, 122, 0.35);
}

.toast.error {
  border-color: rgba(223, 82, 97, 0.35);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
}

/* Bottom navigation */

.bottom-navigation {
  display: none;
}

/* Responsive */

@media (max-width: 1180px) {
  .tariff-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    min-height: auto;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  :root {
    --header-height: 62px;
  }

  .topbar {
    padding: 0 14px;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .brand-copy small,
  .balance-chip {
    display: none;
  }

  .sidebar {
    width: 260px;
    box-shadow: 25px 0 55px rgba(0, 0, 0, 0.4);
    transform: translateX(-103%);
    transition: transform 0.25s ease;
  }

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

  .mobile-overlay.open {
    position: fixed;
    z-index: 25;
    inset: var(--header-height) 0 0;
    display: block;
    background: rgba(2, 4, 8, 0.6);
    backdrop-filter: blur(3px);
  }

  .main-content {
    padding: calc(var(--header-height) + 20px) 14px 96px;
    margin-left: 0;
  }

  .page-heading {
    margin-bottom: 18px;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-balance {
    grid-column: 1 / -1;
    align-items: flex-start;
    padding: 14px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .tariff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-details {
    grid-template-columns: 1fr 1fr;
  }

  .bottom-navigation {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 70px;
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    backdrop-filter: blur(18px);
  }

  .bottom-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    color: var(--text-muted);
    background: transparent;
    font-size: 9px;
    font-weight: 700;
  }

  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .bottom-nav-item.active {
    color: #7da9ff;
  }
}

@media (max-width: 560px) {
  .brand-copy strong {
    font-size: 14px;
  }

  .card {
    padding: 16px;
  }

  .profile-hero {
    gap: 13px;
  }

  .avatar-large {
    width: 65px;
    height: 65px;
    border-radius: 20px;
  }

  .profile-main h2 {
    font-size: 19px;
  }

  .details-list > div {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .tariff-grid {
    grid-template-columns: 1fr;
  }

  .tariff-card p {
    min-height: 0;
  }

  .order-details {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .product-actions {
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: row;
  }

  .product-actions button {
    flex: 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }

  .partner-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-item {
    gap: 9px;
  }

  .document-item strong {
    font-size: 11px;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}