/* box-shell — лаунчер экосистемы. Бренд «Гранит»: синий→зелёный градиент + зелёный акцент, Roboto.
   Токены dc-ui подхватываются из общей темы (BrandCSS); ниже — собственные значения с фолбэком,
   чтобы страница выглядела корректно и без внешней темы. */
:root {
  --shell-blue: #1668dc;
  --shell-blue-deep: #0b4bb0;
  --shell-green: #5bbf1d;
  --shell-ink: #0f2a43;
  --shell-muted: #5b7189;
  --shell-card: rgba(255, 255, 255, 0.66);
  --shell-card-brd: rgba(255, 255, 255, 0.9);
  --shell-shadow: 0 10px 40px rgba(16, 60, 110, 0.18);
  /* Текст на подложке (заголовок/подзаголовок/футер) — «чёрный графит», КОНСТАНТА в любой теме:
     фон всегда светлая картинка, поэтому этот текст не инвертируем. */
  --shell-graphite: #23272e;
  --shell-graphite-soft: #55606d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --shell-ink: #eaf2fb;
    --shell-muted: #9fb3ca;
    --shell-card: rgba(18, 32, 52, 0.55);
    --shell-card-brd: rgba(120, 160, 210, 0.28);
    --shell-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--shell-ink);
  min-height: 100%;
  display: flex;
  position: relative;
  overflow-x: hidden;
}

/* Фон — фирменная подложка «стеклянные кубы» синий→зелёный. Растр bg.png (запасной слой — градиент,
   если картинка не загрузилась). Вернуть на SVG-версию: url("bg.svg"). */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("bg.png") center / cover no-repeat, linear-gradient(120deg, #d8ecff 0%, #eefaf0 55%, #eaffd6 100%);
}

.shell {
  margin: auto;
  width: min(980px, 94vw);
  padding: 48px 0;
  display: flex;
  flex-direction: column;
}

/* Фирменная стеклянная плашка (glassmorphism dc-ui): вся информация на матовом стекле со
   скруглениями. Светлая в любой теме — фон всегда светлая подложка, текст графитовый. */
.shell__panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 44px clamp(24px, 5vw, 52px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 70px rgba(16, 60, 110, 0.20);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.shell__panel--wide { max-width: 960px; margin: 0 auto; }
.shell__panel--login {
  max-width: 460px;
  margin: 0 auto;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.shell__head { text-align: center; }
.brand-logo { height: 30px; width: auto; display: inline-block; }
.shell__title {
  margin: 16px 0 4px;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: var(--shell-graphite); /* «чёрный графит», читается на светлой подложке в любой теме */
}
.shell__sub { margin: 0; color: var(--shell-graphite-soft); font-size: 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 18px;
  text-decoration: none;
  color: var(--shell-ink);
  background: var(--shell-card);
  border: 1px solid var(--shell-card-brd);
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
/* На hover меняем ТОЛЬКО подъём/тень; цвет текста НЕ трогаем (перебиваем возможный синий a:hover
   из общей темы dc-ui) — иначе текст плохо читается. Держим исходный цвет плитки. */
.tile:hover, .tile:focus, .tile:hover .tile__label, .tile:hover .tile__desc {
  color: var(--shell-ink);
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(16, 60, 110, 0.26);
}

/* «Кубик» плитки — маленький глянцевый квадрат, цвет по продукту (синий→зелёный спектр). */
.tile__cube {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff; /* для иконки внутри кубика (напр. шестерёнка настроек) */
  background: linear-gradient(145deg, var(--shell-blue), var(--shell-blue-deep));
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.45), 0 4px 12px rgba(11, 75, 176, 0.35);
}
.tile__cube svg { width: 21px; height: 21px; }
.tile__cube--crm { background: linear-gradient(145deg, #16b28a, #0f7d63); }
.tile__cube--task { background: linear-gradient(145deg, #2f8ae0, #1668dc); }
.tile__cube--assistant { background: linear-gradient(145deg, var(--shell-green), #3f9a12); }
/* Белая подложка под логотип продукта: цветной глиф читается на белом лучше, чем на тёмном стекле. */
.tile__cube--logo, .tile__cube--admin {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 60, 110, 0.06), 0 4px 12px rgba(16, 60, 110, 0.16);
}
.tile__cube--admin { color: #4a5a72; } /* шестерёнка настроек — графит на белом */
.tile__logo { width: 26px; height: 26px; display: block; }

.tile__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile__label { font-weight: 700; font-size: 17px; }
.tile__desc { color: var(--shell-muted); font-size: 13px; }
.tile__go {
  margin-left: auto;
  font-size: 20px;
  color: var(--shell-green);
  opacity: 0.7;
  transition: transform 0.16s ease;
}
.tile:hover .tile__go { transform: translateX(4px); opacity: 1; }
.tile--admin { border-style: dashed; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--shell-muted);
  padding: 40px;
}

.shell__foot {
  text-align: center; color: var(--shell-graphite-soft); font-size: 13px;
}

/* Аккаунт в правом верхнем углу (где привычно ждут данные об авторизации): стеклянный чип. */
.account {
  position: fixed; top: 18px; right: 20px; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(16, 60, 110, 0.16);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.account__ava {
  width: 30px; height: 30px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--shell-blue), var(--shell-blue-deep));
}
.account__ava svg { width: 17px; height: 17px; }
.account__ava img { width: 100%; height: 100%; object-fit: cover; }
.account__name {
  color: var(--shell-graphite); font-weight: 600; font-size: 14px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account__logout {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  color: var(--shell-graphite-soft); transition: background .16s ease, color .16s ease;
}
.account__logout:hover { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.account__logout svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .account__name { display: none; } }

/* Экран входа (нет сессии) */
.login {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 20px 0 8px;
}
.login__btn {
  font-size: 16px; padding: 14px 30px; border-radius: 14px;
  /* фолбэк, если dc-ui .dc-btn не подгрузилась */
  background: linear-gradient(135deg, var(--shell-blue), var(--shell-blue-deep));
  color: #fff; text-decoration: none; font-weight: 700;
  box-shadow: 0 10px 30px rgba(11, 75, 176, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.login__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(11, 75, 176, 0.45); color: #fff; }
.login__hint { color: var(--shell-graphite-soft); font-size: 13.5px; margin: 0; text-align: center; }

/* Уведомление/ошибка */
.notice { border-radius: 12px; padding: 12px 16px; font-size: 14px; text-align: center; }
.notice--err { background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); color: #b42318; }
