/* Reynard. Каркас кабинета: шапка, навигация, страница, сетка. */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px var(--page-x);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  transition: box-shadow var(--t-fast) var(--ease);
}
.topbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar-logo { display: flex; align-items: center; flex: none; border-radius: 8px; }
.topbar-logo svg { height: 36px; width: auto; }
.topbar-logo .mark-only { display: none; }
.topbar-nav { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.menu-toggle { display: none; }

.logo-word { fill: var(--ink); }

/* Состояние агента в шапке. */
.agent-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 6px 0 7px;
  border-radius: var(--r-full);
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.agent-chip .type-block { width: 44px; height: 38px; border-radius: var(--r-full); }
.agent-chip .ac-txt { display: flex; flex-direction: column; min-width: 0; }
.agent-chip .ac-title { font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.agent-chip .ac-sub { font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; }
.agent-chip .icon-btn { margin-left: 2px; }
.agent-chip.stopped .ac-title { color: var(--danger); }

.avatar-btn { border-radius: 50%; transition: transform var(--t-fast) var(--ease); }
.avatar-btn:active { transform: scale(.96); }
.avatar-btn .avatar { width: 46px; height: 46px; font-size: 15px; box-shadow: 0 0 0 2px var(--raised); }

/* Плашка остановленного агента. */
.stop-banner {
  margin: 4px var(--page-x) 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 14px 14px 18px;
  border-radius: var(--r-xl);
  background: var(--raised);
  box-shadow: inset 0 0 0 1.5px var(--danger), var(--shadow-sm);
  animation: rise var(--t-panel) var(--ease) both;
}
.stop-banner .sb-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #FFFFFF; flex: none; }
:root[data-theme="dark"] .stop-banner .sb-ico { color: #15120F; }
.stop-banner .grow { flex: 1; min-width: 0; }
.stop-banner .sb-title { font-weight: 600; }
.stop-banner .sb-sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

.role-banner {
  margin: 4px var(--page-x) 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-full);
  background: var(--sunken);
  font-size: 14px;
  line-height: 20px;
}
.role-banner .grow { flex: 1; min-width: 0; }
.role-banner .i { width: 18px; height: 18px; color: var(--ink-muted); }

/* Страница. На широких экранах кабинет занимает всю ширину: так видно больше колонок воронки и таблиц. */
.main {
  width: 100%;
  margin: 0 auto;
  padding: 18px var(--page-x) 72px;
  flex: 1;
}
.view { display: flex; flex-direction: column; gap: var(--gap); }
.view > * { animation: rise var(--t-panel) var(--ease) both; }
.view > *:nth-child(2) { animation-delay: 40ms; }
.view > *:nth-child(3) { animation-delay: 80ms; }
.view > *:nth-child(4) { animation-delay: 120ms; }
.view > *:nth-child(5) { animation-delay: 160ms; }
.view > *:nth-child(n+6) { animation-delay: 200ms; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 6px; }
.page-head .ph-txt { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.page-head h1 { font-size: 44px; line-height: 50px; font-weight: 300; letter-spacing: -.03em; }
.page-head .ph-sub { font-size: 16px; line-height: 24px; color: var(--ink-muted); max-width: 720px; margin-top: -4px; }
.page-head .ph-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .i { width: 14px; height: 14px; }

.subnav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid.stretch { align-items: stretch; }
.s-12 { grid-column: span 12; }
.s-9 { grid-column: span 9; }
.s-8 { grid-column: span 8; }
.s-7 { grid-column: span 7; }
.s-6 { grid-column: span 6; }
.s-5 { grid-column: span 5; }
.s-4 { grid-column: span 4; }
.s-3 { grid-column: span 3; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.cols-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }

.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.g4 { gap: 4px; }
.row.g8 { gap: 8px; }
.row.g16 { gap: 16px; }
.row.g24 { gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack.g4 { gap: 4px; }
.stack.g8 { gap: 8px; }
.stack.g16 { gap: 16px; }
.stack.g20 { gap: 20px; }
.stack.g24 { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.sec-title { font-size: 22px; line-height: 28px; font-weight: 400; letter-spacing: -.015em; }

/* Мобильное меню. */
.mnav { display: flex; flex-direction: column; gap: 4px; }
.mnav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  font-size: 17px;
  font-weight: 500;
}
.mnav a .i { width: 20px; height: 20px; }
.mnav a.active { background: var(--inverse); color: var(--on-inverse); }

@media (max-width: 1360px) {
  .agent-chip .ac-txt { display: none; }
  .agent-chip { gap: 6px; }
}
@media (max-width: 1220px) {
  .topbar-logo .full { display: none; }
  .topbar-logo .mark-only { display: block; }
  .tab { padding: 0 14px; }
}
@media (max-width: 1100px) {
  :root { --page-x: 24px; }
  .s-9, .s-8, .s-7, .s-6, .s-5, .s-4, .s-3 { grid-column: span 12; }
  .grid.keep-2 > .s-6 { grid-column: span 6; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Испанские подписи длиннее, на узком экране сжимаем отступы вкладок */
@media (max-width: 1100px) {
  html[lang="es"] .topbar-nav .tab { padding: 0 11px; }
}
@media (max-width: 1000px) {
  .topbar-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .topbar { justify-content: space-between; }
  .topbar-logo .full { display: block; }
  .topbar-logo .mark-only { display: none; }
}
@media (max-width: 760px) {
  :root { --page-x: 16px; --gap: 14px; }
  .topbar { padding-top: 12px; padding-bottom: 12px; gap: 10px; }
  .topbar-logo svg { height: 30px; }
  .topbar-right { gap: 8px; }
  .agent-chip { height: 44px; padding: 0 4px 0 5px; }
  .agent-chip .type-block { width: 36px; height: 32px; }
  .agent-chip .icon-btn { width: 32px; height: 32px; }
  .avatar-btn .avatar { width: 40px; height: 40px; }
  .topbar .icon-btn.lg { width: 44px; height: 44px; }
  .page-head h1 { font-size: 34px; line-height: 40px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .grid.keep-2 > .s-6 { grid-column: span 12; }
  .card { padding: 20px; border-radius: 22px; }
  .modal, .drawer { padding: 22px; border-radius: 24px; }
  .overlay { padding: 12px; align-items: end; }
  .overlay.side { padding: 8px; }
  .stat-value { font-size: 38px; line-height: 44px; }
  .stop-banner { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .topbar-logo .full { display: none; }
  .topbar-logo .mark-only { display: block; }
}
