/* HamaliVPN partner portal — premium dark theme, no external deps. */
:root {
  --bg: #07080f;
  --bg-soft: #0d0f1c;
  --card: rgba(18, 22, 42, 0.72);
  --card-solid: #11162b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1ff;
  --muted: #8b91b5;
  --muted-2: #5b6188;
  --accent: #7c5cff;
  --accent-2: #19d3c5;
  --accent-3: #b9a7ff;
  --gold: #f7d774;
  --grad: linear-gradient(135deg, #8a6cff 0%, #19d3c5 58%, #f7d774 125%);
  --grad-hot: linear-gradient(135deg, #a58cff 0%, #51fff1 52%, #ffe49a 120%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(25, 211, 197, 0.13));
  --ok: #36d399;
  --warn: #fbbf24;
  --danger: #f4516c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.9);
  --glow: 0 0 42px rgba(124, 92, 255, 0.22), 0 0 80px rgba(25, 211, 197, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Apple Color Emoji", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 78% -14%, rgba(124, 92, 255, 0.28), transparent 62%),
    radial-gradient(860px 520px at -10% 4%, rgba(25, 211, 197, 0.18), transparent 58%),
    radial-gradient(780px 480px at 50% 115%, rgba(247, 215, 116, 0.08), transparent 64%),
    linear-gradient(180deg, #080912 0%, #050611 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
body::before, body::after {
  content: ""; position: fixed; pointer-events: none; z-index: 0;
}
body::before {
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 14%, black 0%, transparent 68%);
  opacity: 0.42;
}
body::after {
  width: 360px; height: 360px; right: -130px; top: 18%;
  border-radius: 999px; background: var(--grad);
  filter: blur(96px); opacity: 0.18; animation: floatAura 9s ease-in-out infinite alternate;
}
body.modal-open { overflow: hidden; }
a { color: inherit; }
button { font-family: inherit; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(81, 255, 241, 0.48); outline-offset: 2px;
}
.ui-icon {
  width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round;
}
.app { position: relative; z-index: 1; min-height: 100vh; }
@keyframes floatAura { from { transform: translate3d(0, -12px, 0) scale(1); } to { transform: translate3d(-38px, 28px, 0) scale(1.08); } }

/* boot splash */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; }
.boot__logo {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-content: center;
  font-weight: 900; font-size: 30px; color: #07080f; background: var(--grad-hot);
  box-shadow: var(--glow);
}
.boot__spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── login ─────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card {
  position: relative; overflow: hidden;
  width: 100%; max-width: 420px; background: linear-gradient(180deg, rgba(25, 29, 52, 0.82), rgba(12, 15, 30, 0.74));
  backdrop-filter: blur(22px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 28px; padding: 36px 30px;
  box-shadow: var(--shadow), var(--glow);
}
.login__card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad-hot);
}
.login__card::after {
  content: ""; position: absolute; width: 190px; height: 190px; right: -80px; top: -90px;
  background: radial-gradient(circle, rgba(25, 211, 197, 0.28), transparent 62%);
  filter: blur(12px); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand__mark {
  position: relative; overflow: hidden;
  width: 44px; height: 44px; border-radius: 14px; background: var(--grad-hot);
  display: grid; place-content: center; color: #07080f; font-weight: 900; font-size: 22px;
  box-shadow: 0 16px 36px -18px rgba(25, 211, 197, 0.9);
}
.brand__mark::after {
  content: ""; position: absolute; inset: -35% auto auto -35%; width: 70%; height: 170%;
  background: rgba(255, 255, 255, 0.42); transform: rotate(28deg);
}
.brand__name { font-weight: 800; font-size: 18px; letter-spacing: 0.2px; }
.brand__sub { color: var(--muted); font-size: 12px; }
.login h1 { font-size: 24px; letter-spacing: -0.5px; margin: 0 0 6px; }
.login p.hint { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; background: rgba(3, 5, 14, 0.56); border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text); padding: 13px 14px; border-radius: var(--radius-sm); font-size: 15px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: rgba(25, 211, 197, 0.75);
  background: rgba(8, 11, 24, 0.78);
  box-shadow: 0 0 0 3px rgba(25, 211, 197, 0.13), 0 0 28px rgba(124, 92, 255, 0.13);
}
textarea.input { resize: vertical; min-height: 72px; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--text);
  min-height: 46px; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14.5px;
  cursor: pointer; transition: transform 0.12s ease, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-120%); transition: transform 0.5s ease; pointer-events: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary {
  background: var(--grad-hot); color: #07080f; border: none;
  box-shadow: 0 18px 42px -24px rgba(25, 211, 197, 0.9), 0 14px 40px -26px rgba(124, 92, 255, 0.9);
}
.btn--primary:hover { filter: brightness(1.06); background: var(--grad-hot); }
.btn--ghost { background: transparent; }
.btn--danger { border-color: rgba(244, 81, 108, 0.5); color: #ffb3c0; background: rgba(244, 81, 108, 0.07); }
.btn--sm { min-height: 38px; padding: 8px 12px; font-size: 13px; width: auto; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── shell ─────────────────────────────────────────── */
.shell { max-width: 1120px; margin: 0 auto; padding: 18px 16px 96px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; margin: 0 -6px 18px; background: rgba(9, 11, 24, 0.72);
  backdrop-filter: blur(18px) saturate(1.2); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: 0 18px 54px -38px rgba(0,0,0,0.95);
}
.topbar__id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar__mark { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; flex: 0 0 auto; }
.topbar__account { min-width: 0; }
.topbar__role { color: var(--muted); font-size: 11.5px; line-height: 1.2; margin-top: 1px; }
.pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 4px 9px; border-radius: 999px; background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(25, 211, 197, 0.16));
  border: 1px solid rgba(25, 211, 197, 0.24);
  color: #9dfbf3;
}
.topbar__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 18px; scrollbar-width: none;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 7, 18, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; min-height: 42px; padding: 9px 15px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: color 0.15s, border-color 0.15s, background 0.15s; white-space: nowrap;
}
.tab .ui-icon { width: 16px; height: 16px; }
.tab.is-active {
  color: var(--text); border-color: rgba(255,255,255,0.14); background: var(--grad-soft);
  box-shadow: 0 12px 28px -22px rgba(25, 211, 197, 0.9);
}
.mobile-nav { display: none; }

.page-head {
  display: flex; align-items: center; gap: 14px; margin: 6px 2px 20px; padding: 2px 0;
}
.page-head__icon {
  width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
  color: #a7fff8; border: 1px solid rgba(25, 211, 197, 0.22); border-radius: 16px;
  background: var(--grad-soft); box-shadow: 0 16px 38px -30px rgba(25, 211, 197, 0.95);
}
.page-head__icon .ui-icon { width: 23px; height: 23px; }
.page-head h1 { margin: 0; font-size: clamp(23px, 3vw, 31px); letter-spacing: -0.75px; line-height: 1.12; }
.page-head p { max-width: 720px; margin: 5px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* cards & grid */
.grid { display: grid; gap: 14px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 27, 50, 0.78), rgba(13, 16, 33, 0.72));
  backdrop-filter: blur(14px) saturate(1.15); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32), transparent);
}
.card::after {
  content: ""; position: absolute; width: 160px; height: 160px; right: -92px; top: -92px;
  border-radius: 999px; background: var(--grad); opacity: 0.08; filter: blur(2px); pointer-events: none;
}
.card h3 { margin: 0 0 14px; font-size: 15px; }
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; inset: auto -30px -42px auto; width: 120px; height: 120px;
  border-radius: 50%; background: var(--grad); opacity: 0.08; filter: blur(6px);
}
.stat__label { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.stat__value { font-size: 29px; font-weight: 900; letter-spacing: -0.8px; position: relative; z-index: 1; }
.stat__value.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__value.warn { color: var(--warn); }
.stat__value.danger { color: var(--danger); }
.stat__sub { color: var(--muted-2); font-size: 12px; margin-top: 4px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 14px; }
.section-title h2 { font-size: 18px; letter-spacing: -0.25px; margin: 0; }

.quickstart {
  margin-top: 14px; padding: 19px; border: 1px solid rgba(25, 211, 197, 0.18); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(25, 211, 197, 0.08) 65%, rgba(247, 215, 116, 0.05));
  box-shadow: 0 24px 62px -46px rgba(25, 211, 197, 0.85);
}
.quickstart__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.quickstart h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -0.3px; }
.eyebrow { color: #9dfbf3; font-size: 10.5px; font-weight: 900; letter-spacing: 0.9px; text-transform: uppercase; }
.quickstart__steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quickstep {
  min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(4, 7, 17, 0.34);
}
.quickstep > span, .notice__icon {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px;
  color: #a7fff8; font-size: 12px; font-weight: 900; border: 1px solid rgba(25, 211, 197, 0.24); background: var(--grad-soft);
}
.quickstep b, .quickstep small { display: block; }
.quickstep b { font-size: 13px; }
.quickstep small { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.notice {
  display: flex; align-items: flex-start; gap: 11px; padding: 14px; margin-bottom: 18px;
  color: var(--text); border: 1px solid rgba(124, 92, 255, 0.22); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(25, 211, 197, 0.055));
}
.notice b, .notice span { display: block; }
.notice b { font-size: 13px; margin-bottom: 2px; }
.notice span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.notice .notice__icon { color: #a7fff8; }

/* list rows */
.rows { display: grid; gap: 10px; }
.row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: linear-gradient(180deg, rgba(17, 22, 43, 0.92), rgba(12, 16, 32, 0.86));
  transition: border-color 0.16s ease, transform 0.12s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.row--clickable { cursor: pointer; user-select: none; }
.row--clickable .row__main { cursor: pointer; }
.row--clickable .row__actions,
.row--clickable .btn { user-select: auto; }
.row::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 99px;
  background: var(--grad); opacity: 0.5;
}
.row:hover {
  border-color: rgba(25, 211, 197, 0.24); background: rgba(18, 21, 42, 0.94); transform: translateY(-1px);
  box-shadow: 0 18px 42px -34px rgba(25, 211, 197, 0.55);
}
.row__main { min-width: 0; flex: 1; }
.row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.035); }
.tag--active { color: var(--ok); border-color: rgba(54, 211, 153, 0.4); }
.tag--expired, .tag--disabled, .tag--error { color: var(--danger); border-color: rgba(244, 81, 108, 0.4); }
.tag--pending, .tag--suspended { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
.amount-pos { color: var(--ok); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }

/* website affiliate partners */
.affiliate-caption { font-size: 12.5px; margin-top: 4px; }
.affiliate-row { align-items: flex-start; }
.affiliate-link {
  margin-top: 7px; color: #8ffcf3; font: 12px/1.35 ui-monospace, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.affiliate-link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.affiliate-link-card .btn { white-space: nowrap; }
.affiliate-modal-head { margin-top: 0; }
.affiliate-modal-head .sub { margin-bottom: 0; }
.affiliate-detail-stats .card { padding: 13px; }
.affiliate-detail-stats .stat__value { font-size: 21px; }
.affiliate-editor { margin-top: 16px; }
.affiliate-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.affiliate-table-wrap .table { min-width: 620px; }
.modal--wide { max-width: 920px; }

/* tariff cards */
.tariff {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: linear-gradient(180deg, rgba(18, 23, 45, 0.94), rgba(11, 15, 30, 0.9));
  display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.tariff::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); opacity: 0.72;
}
.tariff:hover {
  border-color: rgba(25, 211, 197, 0.28); transform: translateY(-3px);
  box-shadow: 0 24px 60px -42px rgba(25, 211, 197, 0.85);
}
.tariff__name { font-weight: 700; font-size: 15px; }
.tariff__price { font-size: 26px; font-weight: 900; letter-spacing: -0.7px; }
.tariff__price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tariff__meta { color: var(--muted); font-size: 12.5px; }
.tariff .btn { margin-top: 10px; }

/* reseller key packages */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mode-card {
  min-width: 0; min-height: 88px; padding: 13px; text-align: left; cursor: pointer;
  color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(3, 5, 14, 0.46); transition: .16s ease;
}
.mode-card strong, .mode-card span { display: block; }
.mode-card strong { font-size: 13.5px; margin-bottom: 5px; }
.mode-card span { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.mode-card:hover { border-color: rgba(25,211,197,.35); transform: translateY(-1px); }
.mode-card.is-active {
  border-color: rgba(25,211,197,.72); background: var(--grad-soft);
  box-shadow: 0 0 0 3px rgba(25,211,197,.08), 0 14px 34px -28px rgba(25,211,197,.9);
}
.pack-explain {
  display: grid; gap: 4px; padding: 13px 14px; margin: 4px 0 16px;
  border: 1px solid rgba(25,211,197,.22); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,92,255,.13), rgba(25,211,197,.08));
}
.pack-explain[hidden] { display: none; }
.pack-explain strong { color: #a7fff8; font-size: 13px; }
.pack-explain span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.seat-progress { height: 4px; max-width: 330px; margin-top: 9px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.07); }
.seat-progress span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.seat-list { display: grid; gap: 8px; margin-top: 14px; }
.seat-item {
  display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px;
  padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(4,7,17,.45);
}
.seat-number {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px;
  color: #9dfbf3; font-size: 12px; font-weight: 900; border: 1px solid rgba(25,211,197,.25);
  background: var(--grad-soft);
}
.seat-main { min-width: 0; }
.seat-main strong, .seat-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-main strong { font-size: 13px; }
.seat-main span { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.seat-actions { display: flex; gap: 6px; }

.muted { color: var(--muted); }
.empty {
  text-align: center; color: var(--muted); padding: 36px 18px; font-size: 14px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: rgba(7, 9, 20, 0.28);
}

/* data tables */
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 13px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.55px; text-transform: uppercase; }
.table td { font-size: 13.5px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .hint { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* operations dashboard */
.ops-grid { margin-top: 14px; }
.kpi-list { display: grid; gap: 11px; }
.kpi-list > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kpi-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kpi-list span { color: var(--muted); font-size: 13px; }
.meter { height: 5px; margin-top: 9px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.meter span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--grad); }
.revenue-chart { min-height: 150px; display: flex; align-items: end; gap: 6px; padding-top: 12px; }
.revenue-bar { min-width: 9px; flex: 1; height: 130px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; }
.revenue-bar span { display: block; width: 100%; max-width: 28px; border-radius: 7px 7px 3px 3px; background: var(--grad); opacity: .86; box-shadow: 0 8px 22px -10px rgba(25,211,197,.8); }
.revenue-bar small { color: var(--muted-2); font-size: 9px; }

/* controlled releases */
.flag-card { overflow: visible; }
.flag-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.range { width: 100%; accent-color: var(--accent-2); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.13); border: 1px solid var(--line-strong); cursor: pointer; transition: .18s ease; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: .18s ease; }
.switch input:checked + span { background: rgba(25,211,197,.24); border-color: rgba(25,211,197,.58); }
.switch input:checked + span::after { transform: translateX(20px); background: #8cfff6; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 4, 10, 0.72); backdrop-filter: blur(6px);
  display: grid; place-items: end center; z-index: 60; padding: 0;
}
.modal {
  position: relative; overflow: auto;
  width: 100%; max-width: 480px; background: linear-gradient(180deg, rgba(20, 25, 48, 0.98), rgba(10, 13, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow), var(--glow); animation: sheet 0.22s ease; max-height: 92dvh; overscroll-behavior: contain;
}
.modal::before {
  content: ""; position: sticky; display: block; top: 0; margin: -6px auto 16px; width: 42px; height: 4px;
  border-radius: 999px; background: rgba(255,255,255,0.18);
}
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal__actions { display: flex; gap: 10px; margin-top: 18px; }
.codebox {
  background: rgba(2, 4, 12, 0.82); border: 1px solid rgba(25, 211, 197, 0.22); border-radius: var(--radius-sm);
  padding: 12px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all;
  color: #8ffcf3; box-shadow: inset 0 0 24px rgba(25, 211, 197, 0.045);
}
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: var(--radius-sm); }
.qr img { width: 200px; height: 200px; display: block; }

@media (min-width: 720px) {
  .modal-backdrop { place-items: center; }
  .modal { border-radius: 22px; }
}

@media (max-width: 719px) {
  body { font-size: 14px; }
  .shell { padding: 8px 12px calc(104px + env(safe-area-inset-bottom)); }
  .topbar {
    top: 6px; margin: 0 0 16px; padding: 10px 11px; border-radius: 17px;
    background: rgba(9, 11, 24, 0.86);
  }
  .topbar__mark { width: 34px; height: 34px; font-size: 17px; }
  .topbar__name { max-width: 48vw; font-size: 13.5px; }
  .topbar__logout { width: 42px; min-height: 42px; padding: 0; border-radius: 13px; }
  .topbar__logout span { display: none; }
  .tabs { display: none; }
  .page-head { align-items: flex-start; gap: 11px; margin: 2px 2px 17px; }
  .page-head__icon { width: 41px; height: 41px; border-radius: 13px; }
  .page-head__icon .ui-icon { width: 20px; height: 20px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { margin-top: 4px; font-size: 12.5px; line-height: 1.38; }
  .affiliate-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .affiliate-stats .stat__value { font-size: 22px; }
  .affiliate-row { display: block; }
  .affiliate-row .row__actions { justify-content: flex-start; margin-top: 12px; }
  .affiliate-link-card { grid-template-columns: 1fr; }
  .affiliate-link-card .btn { width: 100%; }
  .affiliate-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mobile-nav {
    position: fixed; z-index: 50; display: block; left: 8px; right: 8px;
    bottom: calc(7px + env(safe-area-inset-bottom)); padding: 6px;
    border: 1px solid rgba(255,255,255,0.13); border-radius: 20px;
    background: rgba(11, 14, 29, 0.9); backdrop-filter: blur(22px) saturate(1.4);
    box-shadow: 0 18px 60px -20px rgba(0,0,0,0.96), 0 0 38px rgba(124,92,255,0.12);
  }
  .mobile-nav__scroll { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .mobile-nav__scroll::-webkit-scrollbar { display: none; }
  .mobile-nav__item {
    min-width: 76px; min-height: 60px; flex: 1 0 76px; padding: 7px 6px 6px; border: 1px solid transparent;
    border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; scroll-snap-align: center;
  }
  .mobile-nav__item .ui-icon { width: 20px; height: 20px; }
  .mobile-nav__item.is-active { color: #b8fff9; border-color: rgba(25,211,197,0.2); background: var(--grad-soft); }

  .grid { gap: 10px; }
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: 1fr; }
  .card { padding: 15px; border-radius: 15px; }
  .stat { min-height: 108px; }
  .stat__label { min-height: 34px; font-size: 11.5px; line-height: 1.35; margin-bottom: 5px; }
  .stat__value { font-size: clamp(21px, 7vw, 27px); letter-spacing: -0.65px; line-height: 1.1; overflow-wrap: anywhere; }
  .stat__sub { font-size: 10.5px; }
  .section-title { align-items: flex-end; gap: 10px; margin: 23px 2px 12px; }
  .section-title > * { min-width: 0; }
  .section-title h2 { font-size: 17px; line-height: 1.25; }
  .section-title .btn { flex: 0 0 auto; }
  .quickstart { padding: 15px; border-radius: 15px; }
  .quickstart__head { align-items: center; margin-bottom: 12px; }
  .quickstart__head .btn { width: auto; }
  .quickstart__steps { grid-template-columns: 1fr; gap: 7px; }
  .quickstep { align-items: center; padding: 10px; }
  .notice { margin-bottom: 15px; }
  .tariff { padding: 16px; }
  .tariff__price { font-size: 24px; }
  .input, .select, textarea.input { min-height: 48px; font-size: 16px; }
  textarea.input { min-height: 84px; }
  .field { margin-bottom: 14px; }
  .field label { font-size: 12px; }
  .modal { padding: 19px 16px calc(18px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 10px); }
  .modal h3 { font-size: 19px; }
  .modal .sub { line-height: 1.45; }
  .codebox { max-height: 112px; overflow: auto; font-size: 12px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .revenue-chart { overflow-x: auto; }
  .revenue-bar { min-width: 16px; }
  .flag-head { align-items: flex-start; }
}

@media (max-width: 520px) {
  .row { align-items: flex-start; flex-direction: column; padding: 13px; }
  .row__title { white-space: normal; overflow: visible; line-height: 1.4; }
  .row__meta { line-height: 1.45; overflow-wrap: anywhere; }
  .row__actions { width: 100%; justify-content: stretch; }
  .row__actions .btn { flex: 1 1 110px; min-height: 42px; }
  .modal__actions { flex-wrap: wrap; }
  .modal__actions .btn { flex: 1 1 140px; }
  .mode-grid { grid-template-columns: 1fr; }
  .seat-item { grid-template-columns: 32px minmax(0,1fr); }
  .seat-actions { grid-column: 1 / -1; }
  .seat-actions .btn { flex: 1; }
  .quickstart__head { align-items: flex-start; }
  .quickstart__head .btn { min-height: 40px; padding: 8px 11px; }
  .qr img { width: min(200px, 65vw); height: auto; aspect-ratio: 1; }
}

@media (max-width: 350px) {
  .shell { padding-left: 9px; padding-right: 9px; }
  .grid--stats { grid-template-columns: 1fr; }
  .stat { min-height: 0; }
  .stat__label { min-height: 0; }
  .page-head p { font-size: 12px; }
}

@media (hover: none) {
  .btn:hover, .row:hover, .tariff:hover, .mode-card:hover { transform: none; }
  .btn:hover::before { transform: translateX(-120%); }
}

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

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(40px);
  background: rgba(15, 19, 38, 0.92); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); color: var(--text);
  padding: 12px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(54, 211, 153, 0.5); box-shadow: 0 18px 52px -30px rgba(54, 211, 153, 0.7); }
.toast.err { border-color: rgba(244, 81, 108, 0.55); box-shadow: 0 18px 52px -30px rgba(244, 81, 108, 0.65); }
