/* Полная рабочая оболочка кабинета на основе утверждённой дизайн-концепции.
   Этот слой загружается последним и соединяет concept-scoped.css с реальными
   вкладками app.js. Данные, API и продуктовые обработчики здесь не меняются. */

body.app-body.cabinet-v2 {
  --cabinet-sidebar: 244px;
  min-width: 320px;
  background: #f6f4f9;
}

.cabinet-v2 .app-topbar { display: none !important; }
.cabinet-v2 #view-app { min-height: 100vh; }

.cabinet-layout.gc2 {
  display: block;
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(800px 420px at 92% -12%, rgba(144, 83, 239, .11), transparent 68%),
    var(--canvas);
}

.cabinet-layout.gc2 > .workspace.app-wrap {
  width: auto;
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 var(--sidebar);
  padding: 34px clamp(24px, 2.8vw, 52px) 112px;
  transition: margin-left .22s ease;
}

.cabinet-layout.gc2 > .sidebar.is-collapsed ~ .workspace,
body.cabinet-sidebar-collapsed .cabinet-layout.gc2 > .workspace.app-wrap {
  margin-left: 76px;
}

.cabinet-layout.gc2 .tab-content {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.cabinet-layout.gc2 .context-card-cta { margin: 0 0 24px; }
.cabinet-layout.gc2 .overview-flow-root { animation: cabinetViewIn .24s ease; }
.cabinet-layout.gc2 .cards-page-head { margin-bottom: 10px; }

@keyframes cabinetViewIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* Профиль и выход в нижней части панели сохраняют реальные обработчики. */
.cabinet-layout.gc2 .cabinet-account {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
}

.cabinet-layout.gc2 .cabinet-account .profile-card {
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.cabinet-layout.gc2 .cabinet-logout {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #8f8798;
  background: #fff;
}

.cabinet-layout.gc2 .cabinet-logout:hover { color: #dc2626; background: #fef2f2; }
.cabinet-layout.gc2 .cabinet-logout svg { width: 17px; height: 17px; }

/* Рабочий обзор повторяет сетку концепта, но показывает живые карты и операции. */
.cabinet-layout.gc2 .overview-virtual-card { cursor: pointer; }
.cabinet-layout.gc2 .overview-virtual-card:focus-visible { outline-offset: 5px; }
.cabinet-layout.gc2 .overview-empty-card .empty-issue { min-height: 360px; }
.cabinet-layout.gc2 .overview-empty-list {
  min-height: 214px;
  border: 1px dashed #ddd4e8;
  border-radius: 17px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 20px;
  color: #8d8593;
  text-align: center;
}
.cabinet-layout.gc2 .overview-empty-list b { color: var(--ink); font-size: 13px; }
.cabinet-layout.gc2 .overview-empty-list span { font-size: 10px; }

/* concept-scoped задаёт базовый размер всем SVG. На продуктовых экранах
   конкретные стили продукта должны иметь приоритет над этим базовым правилом. */
.cabinet-layout.gc2 #tab-services svg,
.cabinet-layout.gc2 #tab-esim svg,
.cabinet-layout.gc2 #tab-ai svg,
.cabinet-layout.gc2 #tab-ref svg,
.cabinet-layout.gc2 #tab-promo svg,
.cabinet-layout.gc2 #tab-hotels svg {
  max-width: 100%;
}

/* В полной оболочке все реальные экраны находятся внутри .gc2. У концепта
   есть базовое `button { color: inherit }`, поэтому возвращаем продуктовым
   CTA их собственные контрастные цвета более специфичными правилами. */
.cabinet-layout.gc2 .card-cta-button { color: #6d28d9; }
.cabinet-layout.gc2 .cta-sticky,
.cabinet-layout.gc2 .btn-gold,
.cabinet-layout.gc2 .promo-inp-btn,
.cabinet-layout.gc2 .myesim-btn--primary,
.cabinet-layout.gc2 .ev2-btn:not(.ev2-btn--ghost),
.cabinet-layout.gc2 .eb-promo-btn,
.cabinet-layout.gc2 .eb-cta,
.cabinet-layout.gc2 .rw-cta:not(.rw-cta--ghost),
.cabinet-layout.gc2 #tab-hotels .htl-btn,
.cabinet-layout.gc2 #tab-hotels .htl-rate__btn,
.cabinet-layout.gc2 .esim-button--primary,
.cabinet-layout.gc2 .ai-go,
.cabinet-layout.gc2 .ai-filter[aria-selected="true"],
.cabinet-layout.gc2 .ai-gact:hover,
.cabinet-layout.gc2 .notice-btn {
  color: #fff;
}

.cabinet-layout.gc2 .ev2-btn--ghost { color: #8b5cf6; }
.cabinet-layout.gc2 .rw-cta--ghost { color: var(--gold); }
.cabinet-layout.gc2 .esim-button--soft,
.cabinet-layout.gc2 .esim-button--white { color: var(--esim-purple); }

@media (max-width: 1199px) {
  body.app-body.cabinet-v2 { --cabinet-sidebar: 76px; }
  .cabinet-layout.gc2 > .workspace.app-wrap {
    margin-left: 76px;
    padding: 28px 24px 112px;
  }
}

@media (max-width: 767px) {
  body.app-body.cabinet-v2 { --cabinet-sidebar: 0px; }
  .cabinet-layout.gc2 { overflow-x: hidden; }
  .cabinet-layout.gc2 > .workspace.app-wrap,
  .cabinet-layout.gc2 > .sidebar.is-collapsed ~ .workspace,
  body.cabinet-sidebar-collapsed .cabinet-layout.gc2 > .workspace.app-wrap {
    width: 100%;
    max-width: 650px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 82px 14px calc(112px + env(safe-area-inset-bottom, 0px));
  }
  .cabinet-layout.gc2 .context-card-cta { margin-bottom: 16px; }
  .cabinet-layout.gc2 .overview-empty-card .empty-issue { min-height: 220px; }
  .cabinet-layout.gc2 .cards-page-head { margin-bottom: 4px; }
  .cabinet-layout.gc2 .card-flow-root .cta-sticky {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(82px, calc(70px + env(safe-area-inset-right, 0px)));
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    transform: none;
  }
}

@media (max-width: 369px) {
  .cabinet-layout.gc2 > .workspace.app-wrap,
  .cabinet-layout.gc2 > .sidebar.is-collapsed ~ .workspace {
    padding-left: 11px;
    padding-right: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cabinet-layout.gc2 .overview-flow-root { animation: none; }
}
