/* ===== Geist шрифт (корпоративный MCPG) ===== */

/* ===== Reset + base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Background layers */
  --bg-page: #0a0a0a;
  --bg-sidebar: #0f0f0f;
  --bg-topbar: #0d0d0d;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --border: #262626;
  --border-hover: #333;

  /* Text */
  --text-1: #e5e5e5;
  --text-2: #a3a3a3;
  --text-3: #737373;

  /* Brand colors (MCPG брендбук) */
  --accent: #00775A;           /* изумрудный — основной */
  --accent-hover: #006b52;
  --accent-soft: rgba(0, 119, 90, 0.14);
  --accent-glow: rgba(0, 119, 90, 0.25);

  /* Secondary palette (брендбук) */
  --entryx: #84c713;           /* EntryX зелёный — success states */
  --info: #0072e3;             /* тёмно-голубой */
  --warning: #FF9D00;          /* голландский оранжевый */
  --danger: #ef4444;

  --topbar-h: 56px;
  --sidebar-w: 220px;
}
html, body {
  background: var(--bg-page);
  color: var(--text-1);
  font-family: "Geist Sans", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
svg { display: block; flex-shrink: 0; }

/* ===== Topbar ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; z-index: 10;
}



.topbar-center { flex: 1; padding-left: 24px; }
.breadcrumbs { color: var(--text-2); font-size: 13px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--entryx); box-shadow: 0 0 0 3px rgba(132,199,19,0.18); }
.status-label { color: var(--entryx); font-weight: 600; letter-spacing: 0.02em; }
.divider { width: 1px; height: 16px; background: var(--border); }
.location { white-space: nowrap; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 20px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.user-chip:hover { border-color: var(--border-hover); }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.user-name { color: var(--text-1); font-weight: 500; }

/* ===== Layout ===== */
.layout { padding-top: var(--topbar-h); display: flex; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}
.nav-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); padding: 0 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active svg { color: var(--accent); }
.nav-item.disabled { color: var(--text-3); opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.nav-item svg { width: 16px; height: 16px; color: var(--text-3); }
.nav-item:hover svg { color: var(--text-1); }
.nav-item.active:hover svg { color: var(--accent); }

.nav-badge {
  margin-left: auto; font-size: 10px;
  padding: 2px 7px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-weight: 700; letter-spacing: 0.02em;
}
.nav-badge.soon { background: var(--bg-card); color: var(--text-3); font-weight: 500; }

.sidebar-footer {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}

/* ===== Main ===== */
.main {
  margin-left: var(--sidebar-w); flex: 1;
  padding: 32px 40px; max-width: 1500px;
}
.main-hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 28px; gap: 24px;
}
.main-hero h1 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.015em;
  font-family: "Geist Sans", sans-serif;
}
.main-hero .greeting {
  color: var(--text-2); font-size: 14px;
  margin-top: 4px; font-weight: 400;
}

.hero-actions { display: flex; gap: 10px; }
.btn {
  padding: 9px 15px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  font-family: "Geist Sans", sans-serif;
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: 0.005em;
}
.btn-outline { border: 1px solid var(--border); color: var(--text-1); }
.btn-outline:hover { border-color: var(--border-hover); background: var(--bg-card); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 1px rgba(0,119,90,0.3);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 1px rgba(0,119,90,0.5), 0 4px 12px var(--accent-glow); }

/* Placeholder для след. шагов */
.placeholder {
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 48px; text-align: center; color: var(--text-3);
  font-size: 14px;
}

/* ===== KPI cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}
.kpi-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: 600;
}
.kpi-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: grid; place-items: center;
}
.kpi-icon svg { width: 16px; height: 16px; color: var(--accent); }
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-1);
  line-height: 1.1;
  font-family: "Geist Sans", sans-serif;
}
.kpi-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 3px;
}
.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}
.kpi-change svg { width: 12px; height: 12px; }
.kpi-change.up { color: var(--entryx); }
.kpi-change.down { color: var(--warning); }
.kpi-change.neutral { color: var(--text-3); }
.kpi-change-label { color: var(--text-3); font-weight: 500; margin-left: 4px; }

/* ===== Charts section ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.chart-card:hover { border-color: var(--border-hover); }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.005em;
}
.chart-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 500;
}
.chart-source {
  font-size: 11px;
  color: var(--text-3);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chart-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}
.chart-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Skeleton chart (SVG imitation, когда PNG нет) */
.chart-skeleton {
  width: 100%;
  height: 200px;
  display: block;
}
.chart-skeleton .axis { stroke: var(--border); stroke-width: 1; }
.chart-skeleton .gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.5; }
.chart-skeleton .axis-label { fill: var(--text-3); font-size: 10px; font-family: "Geist Sans", sans-serif; }
.chart-skeleton .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-skeleton .area { fill: var(--accent); opacity: 0.12; }
.chart-skeleton .dot { fill: var(--accent); }
.chart-skeleton .bar { fill: var(--accent); opacity: 0.55; }
.chart-skeleton .bar-2 { fill: var(--info); opacity: 0.55; }

/* ===== Modules grid ===== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: all 0.15s ease;
  position: relative;
  cursor: default;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.module-card:not(.disabled):hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 119, 90, 0.12);
}
.module-card.disabled {
  opacity: 0.5;
  background: var(--bg-sidebar);
}
.module-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.module-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: grid; place-items: center;
}
.module-icon svg { width: 18px; height: 18px; color: var(--accent); stroke-width: 2; }
.module-card.disabled .module-icon { background: var(--bg-card); }
.module-card.disabled .module-icon svg { color: var(--text-3); }

.module-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  height: fit-content;
}
.module-badge.new { background: var(--accent); color: #fff; }
.module-badge.beta { background: rgba(255,157,0,0.15); color: var(--warning); }
.module-badge.soon { background: var(--bg-page); color: var(--text-3); border: 1px solid var(--border); }
.module-badge.category { background: var(--bg-page); color: var(--text-2); border: 1px solid var(--border); font-weight: 600; }

.module-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.module-desc {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.45;
}

/* ===== Activity feed ===== */
.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.activity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.activity-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity-title .live-mini {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--entryx);
  box-shadow: 0 0 0 3px rgba(132,199,19,0.18);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.activity-counter {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}
.activity-list {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: grid;
  grid-template-columns: 88px 28px 1fr;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; padding-bottom: 2px; }
.activity-time {
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.activity-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.activity-icon.check { background: rgba(132,199,19,0.14); }
.activity-icon.check svg { color: var(--entryx); }
.activity-icon.zap   { background: var(--accent-soft); }
.activity-icon.zap svg   { color: var(--accent); }
.activity-icon.chart { background: rgba(0,114,227,0.14); }
.activity-icon.chart svg { color: var(--info); }
.activity-icon svg { width: 13px; height: 13px; stroke-width: 2.5; }
.activity-text { color: var(--text-1); line-height: 1.4; }
.activity-text strong { color: var(--text-1); font-weight: 600; }
.activity-text .muted { color: var(--text-3); }

/* ===== Floating buttons (right-bottom) ===== */
.fab-stack {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  z-index: 50;
}
.fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 28px;
  font-family: "Geist Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fab svg { width: 16px; height: 16px; stroke-width: 2; }
.fab-avatar {
  background: var(--bg-card);
  color: var(--text-1);
  border-color: var(--border);
}
.fab-avatar:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.fab-avatar svg { color: var(--accent); }
.fab-jarvis {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 119, 90, 0.45);
}
.fab-jarvis:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 119, 90, 0.55);
}
.fab-jarvis svg { width: 22px; height: 22px; stroke-width: 2; }
.fab-jarvis.hidden { opacity: 0; transform: scale(0.6); pointer-events: none; }

/* ===== Jarvis chat panel ===== */
.chat-panel {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 400px;
  height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  z-index: 60;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.chat-avatar svg { width: 18px; height: 18px; stroke-width: 2; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.005em;
}
.chat-header-sub {
  font-size: 11px;
  color: var(--entryx);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.chat-header-sub::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--entryx);
}
.chat-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: all 0.12s;
}
.chat-close:hover { background: var(--bg-card-hover); color: var(--text-1); }
.chat-close svg { width: 16px; height: 16px; stroke-width: 2; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}
.msg.bot {
  background: var(--bg-sidebar);
  color: var(--text-1);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.msg.bot strong { color: var(--text-1); font-weight: 600; }
.msg.bot .muted { color: var(--text-3); font-size: 12px; }
.msg.bot pre {
  font-family: "Geist Mono", "SF Mono", Menlo, monospace;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-2);
}

.msg-typing {
  align-self: flex-start;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}
.msg-typing span {
  width: 6px;
  height: 6px;
  background: var(--text-3);
  border-radius: 50%;
  animation: dot-bounce 1.3s infinite ease-in-out;
}
.msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-chips {
  padding: 10px 14px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
}
.chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 16px;
  background: var(--bg-page);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.12s;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-footer {
  padding: 10px 14px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-3);
  font-family: "Geist Sans", sans-serif;
  cursor: not-allowed;
}
.chat-telegram {
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s;
}
.chat-telegram:hover { background: var(--accent-hover); }
.chat-telegram svg { width: 13px; height: 13px; stroke-width: 2.5; }

/* ===== Avatar modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(640px, 100%);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.modal-body { padding: 24px; }
.modal-body video { width: 100%; border-radius: 8px; background: var(--bg-page); }
.modal-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--bg-page);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
  text-align: center;
  padding: 24px;
}
.modal-placeholder svg { width: 40px; height: 40px; color: var(--accent); }
.modal-placeholder-title {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}
.modal-placeholder-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 360px;
  line-height: 1.5;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ===== Floating buttons (right-bottom) ===== */
.fab-stack {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  z-index: 50;
}
.fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 28px;
  font-family: "Geist Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fab svg { width: 16px; height: 16px; stroke-width: 2; }
.fab-avatar {
  background: var(--bg-card);
  color: var(--text-1);
  border-color: var(--border);
}
.fab-avatar:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.fab-avatar svg { color: var(--accent); }
.fab-jarvis {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 119, 90, 0.45);
}
.fab-jarvis:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 119, 90, 0.55);
}
.fab-jarvis svg { width: 22px; height: 22px; stroke-width: 2; }
.fab-jarvis.hidden { opacity: 0; transform: scale(0.6); pointer-events: none; }

/* ===== Jarvis chat panel ===== */
.chat-panel {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 400px;
  height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  z-index: 60;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.chat-avatar svg { width: 18px; height: 18px; stroke-width: 2; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.005em;
}
.chat-header-sub {
  font-size: 11px;
  color: var(--entryx);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.chat-header-sub::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--entryx);
}
.chat-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: all 0.12s;
}
.chat-close:hover { background: var(--bg-card-hover); color: var(--text-1); }
.chat-close svg { width: 16px; height: 16px; stroke-width: 2; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}
.msg.bot {
  background: var(--bg-sidebar);
  color: var(--text-1);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.msg.bot strong { color: var(--text-1); font-weight: 600; }
.msg.bot .muted { color: var(--text-3); font-size: 12px; }
.msg.bot pre {
  font-family: "Geist Mono", "SF Mono", Menlo, monospace;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-2);
}

.msg-typing {
  align-self: flex-start;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}
.msg-typing span {
  width: 6px;
  height: 6px;
  background: var(--text-3);
  border-radius: 50%;
  animation: dot-bounce 1.3s infinite ease-in-out;
}
.msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-chips {
  padding: 10px 14px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
}
.chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 16px;
  background: var(--bg-page);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.12s;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-footer {
  padding: 10px 14px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-3);
  font-family: "Geist Sans", sans-serif;
  cursor: not-allowed;
}
.chat-telegram {
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s;
}
.chat-telegram:hover { background: var(--accent-hover); }
.chat-telegram svg { width: 13px; height: 13px; stroke-width: 2.5; }

/* ===== Avatar modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(640px, 100%);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.modal-body { padding: 24px; }
.modal-body video { width: 100%; border-radius: 8px; background: var(--bg-page); }
.modal-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--bg-page);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
  text-align: center;
  padding: 24px;
}
.modal-placeholder svg { width: 40px; height: 40px; color: var(--accent); }
.modal-placeholder-title {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}
.modal-placeholder-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 360px;
  line-height: 1.5;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ===== Brand logo (inline SVG) ===== */
.brand {
  display: flex;
  align-items: center;
  width: calc(var(--sidebar-w) - 24px);
  color: var(--accent);
  transition: opacity 0.15s;
}
.brand:hover { opacity: 0.85; }
.brand-svg {
  height: 22px;
  width: auto;
  display: block;
}

/* ===== Typography refinement (уходим от generic "system-ui" look) ===== */
html, body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
}

/* Hero — крупнее и увереннее */
.main-hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.main-hero .greeting {
  font-size: 14.5px;
  font-weight: 450;
  margin-top: 6px;
  letter-spacing: -0.005em;
}

/* KPI — числа в Geist Mono для выравнивания */
.kpi-value {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
}
.kpi-unit {
  font-family: "Geist", sans-serif;
  font-weight: 500;
  letter-spacing: 0;
}
.kpi-label {
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 10.5px;
}

/* Section titles (charts, activity, modules) — акцентная тонкая линия слева */
.chart-title, .activity-title, .module-title {
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Кнопки в hero — увеличим вес и плотность */
.btn { font-weight: 600; letter-spacing: -0.003em; }
.btn-primary {
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 4px 14px rgba(0,119,90,0.3);
}

/* Nav items чуть крупнее и «корпоративнее» */
.nav-item { font-size: 13px; letter-spacing: -0.005em; }
.nav-section-title {
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 10.5px;
}

/* Числа в activity time — моно */
.activity-time {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  font-weight: 500;
}

/* Topbar — логотип чуть крупнее */
.brand-svg { height: 24px; }

/* Внешние линки в sidebar */
.nav-ext {
  margin-left: auto;
  width: 12px !important;
  height: 12px !important;
  opacity: 0.55;
  stroke-width: 2.2;
}
.nav-item:hover .nav-ext { opacity: 0.9; }

/* ===== Typography scale — bump up for better readability ===== */

/* Global base → 15px вместо 14px */
html, body { font-size: 15px; }

/* Topbar */
.breadcrumbs { font-size: 14px; font-weight: 500; }
.topbar-right { font-size: 13.5px; }
.location { font-size: 13.5px; }
.user-name { font-size: 14px; font-weight: 600; }
.user-avatar { font-size: 12px; }
.status-label { font-size: 12.5px; }
.brand-svg { height: 26px; }

/* Hero */
.main-hero h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.028em;
}
.main-hero .greeting {
  font-size: 15.5px;
  margin-top: 8px;
}

/* Buttons in hero */
.btn { padding: 10px 18px; font-size: 14px; }

/* KPI cards */
.kpi-card { padding: 22px 24px; }
.kpi-label { font-size: 11.5px; }
.kpi-value { font-size: 34px; }
.kpi-unit { font-size: 17px; }
.kpi-change { font-size: 13px; margin-top: 12px; }
.kpi-change-label { font-size: 12.5px; }
.kpi-icon { width: 36px; height: 36px; }
.kpi-icon svg { width: 18px; height: 18px; }

/* Chart cards */
.chart-card { padding: 22px 24px; min-height: 300px; }
.chart-title { font-size: 15.5px; }
.chart-sub { font-size: 13px; margin-top: 3px; }
.chart-source { font-size: 11.5px; padding: 4px 10px; }

/* Module cards */
.module-card { padding: 20px 22px; min-height: 140px; }
.module-title { font-size: 15.5px; margin-bottom: 5px; }
.module-desc { font-size: 13.5px; line-height: 1.5; }
.module-icon { width: 38px; height: 38px; }
.module-icon svg { width: 20px; height: 20px; }
.module-badge { font-size: 10.5px; padding: 4px 9px; }

/* Activity feed */
.activity-card { padding: 22px 26px; }
.activity-title { font-size: 15.5px; }
.activity-counter { font-size: 12px; }
.activity-item { font-size: 14px; padding: 13px 0; grid-template-columns: 96px 30px 1fr; gap: 16px; }
.activity-time { font-size: 12px; }
.activity-icon { width: 28px; height: 28px; }
.activity-icon svg { width: 14px; height: 14px; }

/* Sidebar */
.nav-item { font-size: 14px; padding: 9px 10px; gap: 11px; }
.nav-item svg { width: 17px; height: 17px; }
.nav-section-title { font-size: 11px; padding: 0 10px 8px; }
.nav-badge { font-size: 10.5px; padding: 2px 8px; }

/* FAB */
.fab { font-size: 14px; padding: 13px 20px; }
.fab-jarvis { width: 60px; height: 60px; }
.fab-jarvis svg { width: 24px; height: 24px; }

/* Chat panel */
.chat-panel { width: 420px; height: 580px; }
.chat-header-title { font-size: 15px; }
.chat-header-sub { font-size: 12px; }
.msg { font-size: 14px; padding: 11px 14px; }
.chip { font-size: 12.5px; padding: 7px 12px; }
.chat-input { font-size: 14px; padding: 10px 13px; }
.chat-telegram { font-size: 13px; padding: 10px 15px; }

/* module-card как ссылка — сохраняем визуал и добавляем ext-индикатор */
.module-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.module-link::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 50px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M15 3h6v6'/><path d='M10 14 21 3'/><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/></svg>") no-repeat center;
  opacity: 0;
  transition: opacity 0.15s;
}
.module-link:hover::after { opacity: 1; }
