:root {
  --cab-blue: #1557ff;
  --cab-blue-deep: #071d50;
  --cab-cyan: #09abd3;
  --cab-green: #168865;
  --cab-red: #d72b3f;
  --cab-ink: #111319;
  --cab-muted: #6b7280;
  --cab-line: #dde1e7;
  --cab-soft: #f5f6f8;
  --cab-white: #fff;
  --sidebar: 18.5rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

.auth-pending body {
  visibility: hidden;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 20rem; background: #f7f8fa; color: var(--cab-ink);
  font-family: Inter, Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid rgba(21,87,255,.38); outline-offset: 3px; }
.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 1.25rem; line-height: 1; letter-spacing: normal; text-transform: none;
}

.cabinet-sidebar {
  position: fixed; z-index: 50; inset: .75rem auto .75rem .75rem; display: flex; flex-direction: column;
  width: var(--sidebar); overflow-y: auto; border: 1px solid var(--cab-line); border-radius: 2rem;
  background: #f3f5f8; box-shadow: 0 18px 42px rgba(28,39,61,.07);
}
.cabinet-brand {
  display: flex; align-items: center; gap: .75rem; padding: 2.2rem 1.7rem 1rem;
  color: var(--cab-blue-deep); font-size: 1.17rem; font-weight: 800; letter-spacing: .045em;
}
.cabinet-brand b { color: var(--cab-red); }
.cabinet-brand__mark { display: grid; gap: 3px; width: 2.25rem; rotate: -8deg; }
.cabinet-brand__mark i { display: block; height: .55rem; border-radius: 999px; }
.cabinet-brand__mark i:first-child { background: #fff; box-shadow: inset 0 0 0 1px rgba(7,29,80,.16); }
.cabinet-brand__mark i:nth-child(2) { background: #1557ff; }
.cabinet-brand__mark i:last-child { background: var(--cab-red); }
.cabinet-sidebar__caption { padding: 0 1.7rem 1.7rem; color: var(--cab-muted); font-size: .82rem; }
.cabinet-home-link {
  display: flex; align-items: center; gap: .85rem; padding: 1.2rem 1.8rem;
  border-top: 1px solid var(--cab-line); border-bottom: 1px solid var(--cab-line);
  color: #4e5665; font-size: .92rem; font-weight: 600;
}
.cabinet-home-link span { color: var(--cab-blue); font-size: 1.2rem; }
.cabinet-nav { display: grid; gap: .3rem; padding: 1.1rem .9rem 1rem; }
.cabinet-nav a {
  position: relative; display: flex; align-items: center; gap: .85rem; min-height: 3.1rem;
  padding: .75rem 1rem; border-radius: 1rem; color: #5c6472; font-size: .88rem; font-weight: 550;
  transition: background-color .2s ease, color .2s ease, translate .2s var(--ease);
}
.cabinet-nav a:hover { translate: .2rem 0; color: var(--cab-ink); }
.cabinet-nav a.is-active { background: #fff; color: var(--cab-ink); box-shadow: 0 8px 22px rgba(28,39,61,.045); }
.cabinet-nav a.is-active::before {
  content: ""; position: absolute; top: .8rem; bottom: .8rem; left: 0; width: .25rem;
  border-radius: 999px; background: var(--cab-blue);
}
.cabinet-nav a span { display: grid; place-items: center; width: 1.35rem; color: #687180; font-size: 1.2rem; }
.cabinet-nav a.is-active span { color: var(--cab-blue); }
.cabinet-sidebar__support {
  display: flex; align-items: center; gap: .8rem; margin: auto .9rem 1rem; padding: .9rem;
  border: 1px solid #dce4f6; border-radius: 1.1rem; background: #fff;
  color: #4f5867; box-shadow: 0 10px 24px rgba(28,39,61,.04);
}
.cabinet-sidebar__support > .material-symbols-rounded {
  display: grid; place-items: center; width: 2.45rem; height: 2.45rem; flex: 0 0 auto;
  border-radius: .8rem; background: #e8edff; color: var(--cab-blue); font-size: 1.25rem;
}
.cabinet-sidebar__support > span:last-child { display: grid; gap: .16rem; }
.cabinet-sidebar__support b { font-size: .78rem; }
.cabinet-sidebar__support small { color: #7b8492; font-size: .67rem; }

.cabinet-workspace { min-height: 100vh; margin-left: calc(var(--sidebar) + 1.5rem); background: #fff; }
.cabinet-topbar {
  position: sticky; z-index: 35; top: 0; display: flex; align-items: center; justify-content: space-between;
  height: 5.25rem; padding: 0 clamp(1.5rem, 3vw, 3rem); border-bottom: 1px solid var(--cab-line);
  background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.topbar-home, .topbar-support {
  display: inline-flex; align-items: center; gap: .65rem; min-height: 2.75rem; padding: 0 1.15rem;
  border: 1px solid var(--cab-line); border-radius: 999px; background: #fff; font-size: .85rem; font-weight: 650;
}
.topbar-home span, .topbar-support span { color: #596271; font-size: 1.1rem; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.topbar-balance { display: inline-flex; align-items: center; gap: .45rem; color: #4f5664; font-size: .88rem; font-weight: 650; }
.topbar-balance i { color: var(--cab-blue); font-size: 1.18rem; font-style: normal; }
.topbar-bell {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: #586170; cursor: pointer;
}
.topbar-user { display: flex; align-items: center; gap: .75rem; padding: 0; border: 0; background: transparent; cursor: pointer; }
.topbar-user span {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--cab-blue); color: #fff; font-size: 1rem; font-weight: 700;
}
.topbar-user b { font-size: .88rem; font-weight: 600; }

.cabinet-main { width: 100%; max-width: 98rem; margin-inline: auto; padding: 2.8rem clamp(1.5rem, 3vw, 3rem) 5rem; }
.cabinet-welcome h1 { font-size: clamp(2.6rem, 4.2vw, 4.5rem); line-height: .98; letter-spacing: -.065em; }
.cabinet-welcome h1 em {
  background: linear-gradient(90deg, var(--cab-blue), var(--cab-cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; font-style: normal;
}
.cabinet-welcome p { margin-top: 1rem; color: var(--cab-muted); font-size: clamp(.95rem, 1.25vw, 1.08rem); line-height: 1.55; }

.cabinet-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2.2rem; }
.stat-card {
  display: flex; flex-direction: column; min-width: 0; min-height: 14rem; padding: 1.55rem;
  border: 1px solid var(--cab-line); border-radius: 2rem; background: #fff;
  box-shadow: 0 12px 34px rgba(28,39,61,.055);
  transition: border-color .2s ease, transform .2s var(--ease), box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: #ccd4df; box-shadow: 0 18px 40px rgba(28,39,61,.08); }
.stat-card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stat-card__head p { color: #596271; font-size: .75rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.stat-card__icon, .product-card__icon {
  display: grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: 0 0 auto;
  border-radius: 50%; font-size: 1.3rem; font-weight: 700;
}
.stat-card__icon--blue, .product-card__icon--blue { background: #e8edff; color: var(--cab-blue); }
.stat-card__icon--green, .product-card__icon--green { background: #e4f2ed; color: var(--cab-green); }
.stat-card__icon--cyan, .product-card__icon--cyan { background: #e4f7fb; color: var(--cab-cyan); }
.stat-card > strong { margin-top: 1rem; font-size: 2.25rem; letter-spacing: -.04em; }
.stat-card > small { margin-top: .2rem; color: #838b99; font-size: .82rem; }
.stat-card > a { width: fit-content; margin-top: auto; color: var(--cab-blue); font-size: .82rem; font-weight: 650; }

.cabinet-dashboard { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(17rem, .85fr); align-items: start; gap: 1.25rem; margin-top: 1.6rem; }
.orders-card {
  min-height: 26rem; padding: 1.8rem; border: 1px solid var(--cab-line); border-radius: 2rem; background: #fff;
  box-shadow: 0 12px 34px rgba(28,39,61,.055);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.panel-heading a { color: var(--cab-blue); font-size: .78rem; font-weight: 600; }
.orders-empty { display: grid; place-items: center; align-content: center; min-height: 20rem; text-align: center; }
.orders-empty__icon { display: grid; place-items: center; width: 3.8rem; height: 3.8rem; border-radius: 50%; background: var(--cab-soft); color: #929aa7; font-size: 1.55rem; }
.orders-empty p { margin-top: 1rem; color: #717987; font-size: .95rem; }
.orders-empty__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-top: 1.3rem; }
.cabinet-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.15rem;
  border-radius: .85rem; background: var(--cab-blue); color: #fff; font-size: .78rem; font-weight: 650;
  transition: translate .2s var(--ease), background-color .2s ease;
}
.cabinet-button:hover { translate: 0 -.15rem; background: #0644dd; }

.cabinet-products > h2 { margin: .1rem 0 1.2rem .3rem; color: #69717e; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.product-card {
  position: relative; overflow: hidden; padding: 1.55rem; border: 1px solid var(--cab-line); border-radius: 2rem; background: #fff;
  box-shadow: 0 12px 34px rgba(28,39,61,.055); transition: transform .2s var(--ease), box-shadow .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(28,39,61,.08); }
.product-card + .product-card { margin-top: 1rem; }
.product-card h3 { margin-top: 1rem; font-size: 1rem; letter-spacing: -.025em; }
.product-card > p { margin-top: .55rem; color: var(--cab-muted); font-size: .82rem; line-height: 1.55; }
.product-card ul { display: grid; gap: .55rem; margin-top: 1rem; }
.product-card li { position: relative; padding-left: 1.25rem; color: #5f6876; font-size: .78rem; line-height: 1.45; }
.product-card li::before { content: "✓"; position: absolute; left: 0; color: var(--cab-cyan); font-weight: 800; }
.product-card > a { display: inline-flex; margin-top: 1.35rem; color: var(--cab-cyan); font-size: .8rem; font-weight: 650; }

.cabinet-view[hidden] { display: none; }
.cabinet-view.is-active { animation: cabinet-view-in .32s var(--ease) both; }
.view-back {
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 2.35rem;
  color: #586170; font-size: .9rem; font-weight: 650;
}
.view-back span { font-size: 1.15rem; transition: transform .2s var(--ease); }
.view-back:hover span { transform: translateX(-3px); }
.view-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 3rem;
}
.view-heading h1 {
  max-width: 60rem; font-size: clamp(2.7rem, 4vw, 4.3rem); line-height: .98;
  letter-spacing: -.065em;
}
.view-heading p { max-width: 58rem; margin-top: .85rem; color: var(--cab-muted); font-size: clamp(.96rem, 1.25vw, 1.1rem); line-height: 1.55; }
.view-primary, .view-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3.35rem;
  padding: 0 1.55rem; border: 0; border-radius: 999px; font: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s ease, background-color .2s ease;
}
.view-primary { flex: 0 0 auto; background: linear-gradient(110deg, var(--cab-blue), var(--cab-cyan)); color: #fff; box-shadow: 0 14px 30px rgba(21,87,255,.19); }
.view-primary:hover, .view-secondary:hover { transform: translateY(-2px); }
.view-primary:hover { box-shadow: 0 18px 36px rgba(21,87,255,.25); }
.view-secondary { border: 1px solid var(--cab-line); background: #fff; color: var(--cab-ink); }
.view-empty {
  display: grid; place-items: center; align-content: center; min-height: 37rem; padding: 3rem;
  border: 1px solid var(--cab-line); border-radius: 2rem; background: #fff; text-align: center;
  box-shadow: 0 14px 38px rgba(28,39,61,.055);
}
.view-empty--compact { min-height: 30rem; }
.view-empty__icon {
  display: grid; place-items: center; width: 4.6rem; height: 4.6rem; margin-bottom: 1.35rem;
  border-radius: 1.45rem; background: #f4f6f9; color: #1f2733; font-size: 2rem;
}
.view-empty h2 { font-size: 1.35rem; letter-spacing: -.03em; }
.view-empty > p { max-width: 30rem; margin-top: .75rem; color: var(--cab-muted); font-size: .98rem; line-height: 1.55; }
.view-empty > .view-primary { margin-top: 1.5rem; }
.view-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.5rem; }
.view-owned { padding: 0 0 3.2rem; border-bottom: 1px solid var(--cab-line); }
.view-owned h2, .catalog-heading h2 { font-size: clamp(1.55rem, 2vw, 2rem); letter-spacing: -.045em; }
.view-owned p { margin-top: 1.15rem; color: var(--cab-muted); font-size: 1rem; line-height: 1.55; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 3.2rem 0 1.65rem; }
.catalog-link { padding: .6rem 0; border: 0; background: transparent; color: var(--cab-blue); font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; }
.country-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.country-card {
  position: relative; display: grid; place-items: center; min-height: 13.5rem; padding: 2rem 1rem 1.4rem;
  border: 1px solid var(--cab-line); border-radius: 1.8rem; background: #fff; text-align: center;
  box-shadow: 0 10px 28px rgba(28,39,61,.045); transition: transform .2s var(--ease), box-shadow .2s ease;
}
.country-card:hover, .service-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(28,39,61,.085); }
.catalog-badge {
  position: absolute; top: -.55rem; left: 50%; translate: -50% 0; z-index: 2;
  padding: .35rem .75rem; border-radius: 999px; background: linear-gradient(110deg, var(--cab-blue), var(--cab-cyan));
  color: #fff; font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.country-card__flag {
  display: grid; place-items: center; width: 4.3rem; height: 3.2rem; overflow: hidden;
  border: 1px solid #e2e5e9; border-radius: .7rem; background: #fff; font-size: 2.6rem; line-height: 1;
  box-shadow: 0 8px 18px rgba(28,39,61,.09);
}
.country-card h3 { margin-top: .9rem; font-size: 1.05rem; }
.country-card p { margin-top: .55rem; color: var(--cab-blue); font-size: .9rem; font-weight: 750; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.service-card {
  position: relative; min-width: 0; padding: .8rem .8rem 1.25rem; border: 1px solid var(--cab-line);
  border-radius: 1.8rem; background: #fff; text-align: center; box-shadow: 0 10px 28px rgba(28,39,61,.045);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.service-card > div { display: grid; place-items: center; aspect-ratio: 1.35; overflow: hidden; border-radius: 1.25rem; }
.service-card img { width: 45%; height: 45%; object-fit: contain; filter: brightness(0) invert(1); }
.service-card h3 { margin-top: 1rem; font-size: 1rem; letter-spacing: -.025em; }
.service-card p { margin-top: .35rem; color: var(--cab-muted); font-size: .76rem; }
.service-card--steam > div { background: #142441; }
.service-card--telegram > div { background: linear-gradient(145deg, #9b48f0, #13a9df); }
.service-card--playstation > div { background: #1468cc; }
.service-card--spotify > div { background: #18a457; }
.service-card--youtube > div { background: #ff3030; }
.service-card--netflix > div { background: #111; }
.cabinet-toast {
  position: fixed; z-index: 100; right: 1.25rem; bottom: 1.25rem; max-width: min(24rem, calc(100vw - 2rem));
  padding: 1rem 1.15rem; border-radius: 1rem; background: var(--cab-blue-deep); color: #fff;
  box-shadow: 0 20px 45px rgba(7,29,80,.25); font-size: .84rem; font-weight: 600;
}
.cabinet-toast[hidden] { display: none; }

@keyframes cabinet-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cabinet-menu {
  position: fixed; z-index: 70; top: 1rem; left: 1rem; display: none; place-items: center; gap: 5px;
  width: 2.8rem; height: 2.8rem; padding: 0; border: 0; border-radius: 50%; background: var(--cab-blue-deep); cursor: pointer;
}
.cabinet-menu span { width: 1.1rem; height: 1px; background: #fff; transition: transform .2s ease; }
.cabinet-menu[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.cabinet-menu[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
.sidebar-backdrop { position: fixed; z-index: 45; inset: 0; background: rgba(7,29,80,.35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sidebar-backdrop[hidden] { display: none; }

@media (max-width: 1120px) {
  :root { --sidebar: 15.5rem; }
  .cabinet-sidebar { border-radius: 1.6rem; }
  .cabinet-brand { padding-inline: 1.2rem; }
  .cabinet-sidebar__caption { padding-inline: 1.2rem; }
  .cabinet-nav a { font-size: .81rem; }
  .cabinet-dashboard { grid-template-columns: minmax(0, 1.45fr) minmax(16rem, .8fr); }
  .country-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --sidebar: 18rem; }
  .cabinet-menu { display: grid; }
  .cabinet-sidebar { z-index: 60; transform: translateX(calc(-100% - 2rem)); transition: transform .3s var(--ease); }
  .cabinet-sidebar.is-open { transform: none; }
  .cabinet-workspace { margin-left: 0; }
  .cabinet-topbar { padding-left: 4.6rem; }
  .topbar-home { display: none; }
  .cabinet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card:last-child { grid-column: 1 / -1; }
  .cabinet-dashboard { grid-template-columns: 1fr; }
  .cabinet-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .cabinet-products > h2 { grid-column: 1 / -1; margin-bottom: .1rem; }
  .product-card + .product-card { margin-top: 0; }
  .product-card:last-child { grid-column: 1 / -1; }
  .view-heading { margin-bottom: 2.4rem; }
  .view-empty { min-height: 31rem; }
}

@media (max-width: 600px) {
  .cabinet-topbar { height: 4.8rem; padding-right: 1rem; }
  .topbar-support, .topbar-user b, .topbar-bell { display: none; }
  .topbar-actions { gap: .7rem; }
  .cabinet-main { padding: 2rem 1rem 4rem; }
  .cabinet-welcome h1 { font-size: clamp(2.4rem, 12vw, 3.25rem); }
  .cabinet-welcome h1 em { display: block; }
  .cabinet-stats { grid-template-columns: 1fr; }
  .stat-card:last-child { grid-column: auto; }
  .stat-card { min-height: 12.5rem; border-radius: 1.5rem; }
  .orders-card { min-height: 24rem; padding: 1.25rem; border-radius: 1.5rem; }
  .orders-empty__actions { width: 100%; flex-direction: column; }
  .cabinet-button { width: 100%; }
  .cabinet-products { grid-template-columns: 1fr; }
  .cabinet-products > h2, .product-card:last-child { grid-column: auto; }
  .product-card { border-radius: 1.5rem; }
  .view-back { margin-bottom: 1.7rem; }
  .view-heading { display: grid; gap: 1.35rem; margin-bottom: 2rem; }
  .view-heading h1 { font-size: clamp(2.35rem, 11vw, 3.2rem); }
  .view-heading .view-primary { width: 100%; }
  .view-empty { min-height: 25rem; padding: 2rem 1.2rem; border-radius: 1.5rem; }
  .view-empty__actions { width: 100%; display: grid; }
  .catalog-heading { margin-top: 2.4rem; }
  .country-grid, .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .country-card { min-height: 12rem; border-radius: 1.35rem; }
  .service-card { border-radius: 1.35rem; }
}

@media (max-width: 390px) {
  .country-grid, .service-grid { grid-template-columns: 1fr; }
}

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