/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 6px;
  flex-shrink: 0;
}

.logo__img {
  display: block;
  height: 52px;
  width: auto;
}

.logo__img--black {
  display: none;
}

html[data-theme="light"] .logo__img--white {
  display: none;
}

html[data-theme="light"] .logo__img--black {
  display: block;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 500;
}

.nav-main a.is-active,
.nav-main a:hover {
  opacity: 1;
}

.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang {
  display: flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-subtle);
}

.lang button.is-active {
  color: var(--text);
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--text);
}

.icon-btn .badge {
  position: absolute;
  top: 0;
  right: -2px;
}

.icon-btn--logout {
  color: var(--danger);
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
}

.burger span,
.burger span::before,
.burger span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  position: relative;
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
}

.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

.hide-sm { display: inline-flex; }

.seats { min-width: 640px; }

.mobile-drawer {
  display: none;
}

.mobile-drawer a,
.mobile-drawer button {
  font-size: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 28px 0 20px;
  border-top: 1px solid var(--border);
}

.footer__top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
}

.footer__top .header__actions {
  margin-left: auto;
}

.footer__mid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  padding: 22px 0 16px;
  border-top: 1px solid var(--border);
}

.footer__col h4 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

.footer__col a {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.footer__col a:hover {
  color: var(--text-muted);
}

.socials {
  display: flex;
  gap: 8px;
  justify-self: end;
  align-self: start;
}

.socials a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
}

.footer__copy {
  text-align: right;
  font-size: 12px;
  color: var(--text-subtle);
  padding-top: 8px;
}

/* Cabinet layout */
.cabinet {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 40px;
  padding-top: 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
}

.side-nav a,
.side-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
  text-align: left;
  width: 100%;
}

.side-nav a.is-active,
.side-nav a:hover {
  color: var(--text);
  font-weight: 650;
}

.side-nav .btn {
  margin-top: 22px;
  justify-content: center;
}

.cabinet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.cabinet__head .tabs {
  flex: 1;
}

.cabinet__title {
  width: 100%;
  margin-bottom: 4px;
}

.tickets-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 18px;
}

.section-head a {
  color: var(--text-muted);
}

.carousel {
  position: relative;
}

.page-head + section .carousel {
  margin-top: 36px;
}

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

.carousel__nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  transform: translateY(-50%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.28);
}

.carousel__nav:first-child {
  left: 18px;
}

.carousel__nav:last-child {
  right: 18px;
}

.carousel__nav:hover {
  background: var(--surface-2);
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
}

.search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search .input {
  border-radius: var(--radius-pill);
  padding-left: 42px;
  min-height: 46px;
}

.search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.basket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.basket-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.basket-item img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.filters .field,
.filters .input,
.filters .select {
  min-height: 44px;
}

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

.charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.seat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 8px;
}

.times {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 28px;
}

.event-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 420px;
  margin-bottom: 28px;
}

.event-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 420px;
}

.event-hero__content {
  position: absolute;
  inset: 0;
  padding: 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  background: var(--hero-overlay);
}

.event-hero h1 {
  color: #fff;
  max-width: 640px;
}

.event-hero p {
  color: rgb(255 255 255 / 0.82);
  margin-top: 8px;
}

.review-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
}

.review-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stars {
  color: var(--gold);
  letter-spacing: 2px;
}

.scheme-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.qr-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
}

.qr-frame {
  width: min(420px, 100%);
  aspect-ratio: 1;
  margin: 32px 0;
  position: relative;
}

.qr-frame::before,
.qr-frame::after,
.qr-frame span::before,
.qr-frame span::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid var(--text);
}

.qr-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.qr-frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.qr-frame span::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.qr-frame span::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.notice-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.support-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.support-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top10-section {
  overflow: hidden;
}

.top10 {
  --top10-width: 20%;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
}

.top10::-webkit-scrollbar {
  display: none;
}

.top10.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.top10__item {
  position: relative;
  isolation: isolate;
  flex: 0 0 var(--top10-width);
  max-width: var(--top10-width);
  padding-left: 80px;
  scroll-snap-align: start;
}

.top10__rank {
  position: absolute;
  top: 140px;
  left: 0;
  z-index: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

html[data-theme="light"] .top10__rank {
  filter: invert(1);
}

.top10__item:nth-child(1) .top10__rank {
  width: 100px;
  aspect-ratio: 0.793651;
  background-image: url("../img/top10/1.svg");
}

.top10__item:nth-child(2) .top10__rank {
  width: 119px;
  aspect-ratio: 0.929688;
  background-image: url("../img/top10/2.svg");
}

.top10__item:nth-child(3) .top10__rank {
  width: 115px;
  aspect-ratio: 0.884615;
  background-image: url("../img/top10/3.svg");
}

.top10__item:nth-child(4) .top10__rank {
  width: 119px;
  aspect-ratio: 0.929688;
  background-image: url("../img/top10/4.svg");
}

.top10__item:nth-child(5) .top10__rank {
  width: 114px;
  aspect-ratio: 0.890625;
  background-image: url("../img/top10/5.svg");
}

.top10__item:nth-child(6) .top10__rank {
  width: 112px;
  aspect-ratio: 0.861538;
  background-image: url("../img/top10/6.svg");
}

.top10__item:nth-child(7) .top10__rank {
  width: 112px;
  aspect-ratio: 0.888889;
  background-image: url("../img/top10/7.svg");
}

.top10__item:nth-child(8) .top10__rank {
  width: 113px;
  aspect-ratio: 0.869231;
  background-image: url("../img/top10/8.svg");
}

.top10__item:nth-child(9) .top10__rank {
  width: 112px;
  aspect-ratio: 0.861538;
  background-image: url("../img/top10/9.svg");
}

.top10__item:nth-child(10) {
  padding-left: 200px;
  flex-basis: calc(var(--top10-width) + 120px);
  max-width: calc(var(--top10-width) + 120px);
}

.top10__item:nth-child(10) .top10__rank {
  width: 223px;
  aspect-ratio: 1.715385;
  background-image: url("../img/top10/10.svg");
}

.top10__media {
  display: block;
  width: 100%;
  aspect-ratio: 0.664865;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
}

.top10__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

.top10__media:hover img {
  transform: scale(1.03);
}

.top10__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  position: relative;
  margin-top: 12px;
  gap: 2px;
}

.top10__title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.top10__title:hover {
  opacity: 0.8;
}

.top10__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  color: #999;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.top10__meta span + span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top10__meta span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  flex: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.media-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.media-thumbs img,
.media-thumbs .add-media {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.add-media {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.person-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  position: relative;
}

.person-card .avatar {
  width: 72px;
  height: 72px;
}

@media (max-width: 1100px) {
  .tickets-grid,
  .cards-grid,
  .events-grid,
  .carousel__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .top10 {
    --top10-width: 33%;
  }
}

@media (max-width: 900px) {
  .cabinet {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
  }

  .side-nav a,
  .side-nav button {
    border-bottom: 0;
    border-right: 1px solid var(--border);
    padding: 10px 14px;
    white-space: nowrap;
  }

  .side-nav .btn {
    margin-top: 0;
    margin-left: 12px;
    flex-shrink: 0;
  }

  .nav-main,
  .header__actions .hide-sm,
  .hide-sm,
  .header__actions .lang {
    display: none !important;
  }

  .burger {
    display: grid;
    margin-left: 0;
  }

  .header__inner {
    gap: 10px;
  }

  .top10 {
    --top10-width: 40%;
  }

  .top10__rank {
    top: 90px;
  }

  .top10__title {
    font-size: 16px;
  }

  .top10__meta {
    font-size: 12px;
  }

  .mobile-drawer.is-open {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: fixed;
    inset: var(--header-h) 0 0;
    background: var(--bg);
    z-index: 39;
    padding: 24px;
  }

  .footer__top {
    flex-wrap: wrap;
  }

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

  .footer__copy,
  .socials {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .event-hero__content {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .event-hero,
  .event-hero img {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .logo__img {
    height: 44px;
  }

  .top10 {
    --top10-width: 80vw;
  }

  .top10__item {
    max-width: 300px;
    flex-basis: 80vw;
  }

  .top10__item:nth-child(10) {
    padding-left: 80px;
    flex-basis: 80vw;
    max-width: 300px;
  }

  .top10__media {
    border-radius: 24px;
  }

  .tickets-grid,
  .cards-grid,
  .events-grid,
  .carousel__track,
  .kpis,
  .charts {
    grid-template-columns: 1fr;
  }

  .header__actions .btn--outline.hide-xs {
    display: none;
  }

  .basket-item {
    grid-template-columns: 48px 1fr auto;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .toasts {
    right: 12px;
    bottom: 12px;
  }
}
