:root {
  --bg: #070a12;
  --bg-2: #0b1020;
  --panel: rgba(16, 22, 38, 0.72);
  --panel-strong: rgba(18, 26, 48, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f8fb;
  --muted: #9da7bd;
  --muted-2: #69738a;
  --accent: #9dfcff;
  --accent-2: #a78bfa;
  --accent-3: #f8d477;
  --good: #62f2b3;
  --warn: #ffd166;
  --danger: #ff6b8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 286px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(157, 252, 255, 0.15), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(167, 139, 250, 0.19), transparent 34%),
    radial-gradient(circle at 54% 90%, rgba(248, 212, 119, 0.09), transparent 38%),
    linear-gradient(135deg, #05070d 0%, #0b1020 48%, #080914 100%);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }

button {
  border: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(157, 252, 255, 0.85);
  outline-offset: 2px;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.orb-a { top: -120px; left: 160px; background: #45f2ff; }
.orb-b { top: 120px; right: -140px; background: #8b5cf6; }
.orb-c { bottom: -180px; left: 35%; background: #ffcf70; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.18));
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.82), rgba(10, 14, 26, 0.54));
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #081018;
  font-weight: 900;
  letter-spacing: -0.05em;
  background:
    linear-gradient(135deg, rgba(157,252,255,1), rgba(167,139,250,1) 58%, rgba(248,212,119,1));
  box-shadow: 0 18px 48px rgba(157,252,255,0.18);
}

.brand strong,
.profile-card strong { display: block; letter-spacing: -0.02em; }
.brand span,
.profile-card span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.nav-list { display: grid; gap: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.055); transform: translateX(2px); }
.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(157,252,255,0.14), rgba(167,139,250,0.13));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09);
}

.nav-icon {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.065);
}

.sidebar-card,
.profile-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 18px 58px rgba(0,0,0,0.22);
}

.sidebar-card { margin-top: auto; }
.sidebar-card p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 0 14px; }

.profile-card { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(157,252,255,0.14);
  color: var(--accent);
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow,
.tiny-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tiny-label { color: var(--muted); }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin: 8px 0 8px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.055em;
  margin-bottom: 12px;
}

h3 {
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 0;
}

.topbar p,
.hero-card p,
.section-toolbar p,
.panel-card p,
.embed-card p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.topbar p { margin-bottom: 0; max-width: 750px; }
.top-actions, .hero-actions, .toolbar-controls, .message-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.primary-btn,
.ghost-btn,
.icon-btn {
  border-radius: 14px;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn {
  padding: 12px 16px;
  color: #081018;
  font-weight: 850;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  box-shadow: 0 16px 42px rgba(157,252,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.28);
}

.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 56px rgba(157,252,255,0.18); }

.ghost-btn {
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line);
}

.ghost-btn:hover { background: rgba(255,255,255,0.09); transform: translateY(-1px); }
.ghost-btn.compact, .primary-btn.compact { padding: 8px 11px; font-size: 13px; border-radius: 12px; }
.primary-btn.full { width: 100%; justify-content: center; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  font-size: 24px;
}

.icon-btn:hover { background: rgba(255,255,255,0.1); }

.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
    rgba(14, 20, 36, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 30%, transparent 68%, rgba(157,252,255,0.08));
  opacity: 0.55;
}

.glass-card > * { position: relative; z-index: 1; }

.view { display: none; animation: fadeUp 0.32s ease both; }
.view.is-visible { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  min-height: 380px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  padding: 32px;
}

.hero-card h2 {
  max-width: 720px;
  font-size: clamp(36px, 5.5vw, 76px);
  letter-spacing: -0.075em;
  line-height: 0.88;
  margin: 18px 0;
}

.premium-pill,
.badge,
.live-dot,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}

.premium-pill {
  color: #081018;
  background: linear-gradient(135deg, rgba(157,252,255,1), rgba(248,212,119,1));
}

.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 99px;
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(98,242,179,0.12);
}

.score-orbit {
  position: relative;
  min-height: 310px;
  display: grid;
  place-items: center;
}

.score-ring {
  width: 205px;
  height: 205px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(8, 12, 22, 0.92) 0 56%, transparent 57%),
    conic-gradient(from 210deg, var(--good), var(--accent), var(--accent-2), rgba(255,255,255,0.1) 76%);
  box-shadow: 0 0 80px rgba(157,252,255,0.16);
}

.score-ring span {
  font-size: 58px;
  font-weight: 950;
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.score-ring small {
  display: block;
  margin-top: -38px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.orbit-chip {
  position: absolute;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 18px 54px rgba(0,0,0,0.28);
}

.chip-1 { top: 42px; right: 12px; }
.chip-2 { left: 0; bottom: 78px; }
.chip-3 { right: 34px; bottom: 26px; }

.ai-brief,
.panel-card,
.table-card,
.section-toolbar { padding: 22px; }

.card-head,
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-toolbar { margin-bottom: 18px; }
.section-toolbar h2 { margin: 6px 0 8px; }
.section-toolbar p { margin-bottom: 0; }

.brief-list { display: grid; gap: 12px; margin-top: 20px; }
.brief-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line);
}

.brief-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(157,252,255,0.12);
}

.brief-item strong { display: block; margin-bottom: 4px; }
.brief-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

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

.kpi-card {
  padding: 20px;
  min-height: 158px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.055);
  box-shadow: 0 18px 58px rgba(0,0,0,0.18);
}

.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kpi-card span { color: var(--muted); font-size: 13px; }
.kpi-value { display: block; margin: 20px 0 8px; font-size: 34px; line-height: 1; font-weight: 950; letter-spacing: -0.06em; }
.kpi-delta { color: var(--good); font-size: 13px; font-weight: 800; }
.kpi-delta.warn { color: var(--warn); }

.content-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr); }

.funnel-wrap { margin-top: 22px; display: grid; gap: 16px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 92px; align-items: center; gap: 12px; }
.funnel-label { color: var(--muted); font-size: 13px; }
.funnel-track { height: 14px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.funnel-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.funnel-value { text-align: right; font-weight: 850; }

.priority-list { display: grid; gap: 12px; margin-top: 18px; }
.priority-card,
.lead-card,
.command-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.055);
}

.priority-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.priority-card strong { display: block; margin-bottom: 6px; }
.priority-card p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }

.score-badge {
  min-width: 50px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #081018;
  font-weight: 950;
  background: linear-gradient(135deg, var(--good), var(--accent));
}

.score-badge.mid { background: linear-gradient(135deg, var(--warn), var(--accent-3)); }
.score-badge.low { color: var(--text); background: rgba(255,255,255,0.09); }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-column {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,0.042);
  padding: 16px;
}

.pipeline-column.is-over { outline: 2px dashed rgba(157,252,255,0.55); outline-offset: -8px; }
.column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 900; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.column-meta { color: var(--muted); font-size: 12px; }

.column-stack { display: grid; gap: 12px; }
.lead-card {
  padding: 15px;
  cursor: grab;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.lead-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.075); border-color: var(--line-strong); }
.lead-card.dragging { opacity: 0.5; transform: scale(0.98); }
.lead-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.lead-card h4 { margin: 0 0 5px; letter-spacing: -0.03em; font-size: 16px; }
.lead-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.meta-chip { color: var(--muted); background: rgba(255,255,255,0.06); border: 1px solid var(--line); padding: 6px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.lead-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.value-text { font-weight: 950; letter-spacing: -0.03em; }
.next-step { color: var(--accent); font-size: 12px; font-weight: 850; }

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  padding: 12px 13px;
  transition: border 0.18s ease, background 0.18s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: rgba(157,252,255,0.55); background: rgba(255,255,255,0.08); }
.compact-input { min-width: 230px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

.table-wrap { overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.leads-table th,
.leads-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.leads-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.leads-table tbody tr { transition: background 0.16s ease; }
.leads-table tbody tr:hover { background: rgba(255,255,255,0.045); }
.client-cell { display: flex; align-items: center; gap: 12px; }
.client-avatar { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: rgba(157,252,255,0.13); color: var(--accent); font-weight: 900; }
.client-cell span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.status-pill.new { color: var(--accent); }
.status-pill.qualified { color: var(--good); }
.status-pill.offer { color: var(--warn); }
.status-pill.won { color: var(--good); background: rgba(98,242,179,0.12); }
.status-pill.lost { color: var(--danger); }
.row-action { color: var(--accent); background: transparent; font-weight: 850; padding: 0; }

.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; }
.assistant-main { min-height: 640px; }
.assistant-composer { display: grid; gap: 12px; margin-top: 26px; }
.assistant-composer label,
.form-row label { color: var(--muted); font-size: 13px; font-weight: 750; }
.message-output {
  min-height: 250px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: rgba(2, 6, 15, 0.42);
  padding: 18px;
  line-height: 1.6;
}
.rule-list { display: grid; gap: 12px; margin-top: 20px; }
.rule-item { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); }
.rule-item strong { color: var(--accent); }
.rule-item span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.intake-grid,
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; }
.public-form,
.modal-form { display: grid; gap: 14px; margin-top: 22px; }
.form-row { display: grid; gap: 8px; }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.textarea { min-height: 110px; resize: vertical; }
.code-snippet { margin: 20px 0; padding: 18px; overflow: auto; border-radius: 20px; border: 1px solid var(--line); background: rgba(2, 6, 15, 0.48); color: #d7e0f2; line-height: 1.6; }
.mini-preview { margin-top: 24px; border: 1px solid var(--line); background: rgba(255,255,255,0.045); border-radius: 24px; padding: 14px; }
.mini-window-head { display: flex; gap: 7px; margin-bottom: 18px; }
.mini-window-head span { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,0.18); }
.mini-lead-card { padding: 16px; border-radius: 18px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); }
.mini-lead-card span { display: block; margin: 8px 0; color: var(--accent); }
.mini-lead-card p { margin-bottom: 0; }

.settings-list { display: grid; gap: 12px; margin-top: 20px; }
.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
}
.toggle-row strong { display: block; }
.toggle-row small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.toggle-row input { width: 44px; height: 24px; accent-color: var(--accent); }

.drawer-backdrop,
.modal-backdrop,
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(10px);
}
.drawer-backdrop.is-open,
.modal-backdrop.is-open,
.command-palette.is-open { display: block; }

.lead-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(520px, 100vw);
  height: 100vh;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  padding: 28px;
  background: rgba(10, 14, 26, 0.92);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 90px rgba(0,0,0,0.44);
  backdrop-filter: blur(28px);
}
.lead-drawer.is-open { transform: translateX(0); }
.drawer-close { position: sticky; top: 0; margin-left: auto; z-index: 2; }
.drawer-header { margin-top: 16px; }
.drawer-header h2 { margin: 10px 0; }
.drawer-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.drawer-metric { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(255,255,255,0.05); }
.drawer-metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.drawer-metric strong { font-size: 20px; letter-spacing: -0.03em; }
.ai-panel { padding: 16px; border-radius: 22px; border: 1px solid rgba(157,252,255,0.2); background: rgba(157,252,255,0.065); margin: 18px 0; }
.ai-panel p { color: var(--muted); line-height: 1.55; margin: 10px 0 0; }
.timeline { display: grid; gap: 12px; margin: 18px 0; }
.timeline-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.timeline-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 5px rgba(157,252,255,0.1); }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transform: translate(-50%, -44%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(12, 17, 31, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.modal-head h2 { margin: 6px 0 0; }

.command-palette { z-index: 50; padding-top: 12vh; }
.command-box {
  width: min(760px, calc(100vw - 28px));
  margin: 0 auto;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(11, 16, 29, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.command-box input {
  width: 100%;
  padding: 22px 24px;
  color: var(--text);
  border: none;
  background: transparent;
  font-size: 18px;
}
.command-results { padding: 0 12px 12px; display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.command-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; text-align: left; color: var(--text); }
.command-item:hover { background: rgba(255,255,255,0.08); }
.command-item span { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: rgba(12, 17, 31, 0.92);
  box-shadow: var(--shadow);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .sidebar-card, .profile-card { display: none; }
  .hero-grid, .hero-card, .two-columns, .assistant-layout, .intake-grid, .settings-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main { padding: 18px; }
  .topbar, .section-toolbar, .card-head { flex-direction: column; align-items: stretch; }
  .top-actions, .toolbar-controls { width: 100%; }
  .top-actions > *, .toolbar-controls > * { flex: 1; }
  .hero-card, .ai-brief, .panel-card, .table-card, .section-toolbar { padding: 18px; border-radius: 24px; }
  .hero-card h2 { font-size: 44px; }
  .score-orbit { min-height: 240px; }
  .score-ring { width: 170px; height: 170px; }
  .score-ring span { font-size: 48px; }
  .orbit-chip { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .pipeline-board { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
  .form-split, .drawer-meta-grid, .drawer-actions { grid-template-columns: 1fr; }
}

/* Подсказки для заказчика: показывают, как адаптировать демо под его сферу */
.rf-client-guide {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 9999;
  width: min(380px, calc(100vw - 24px));
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(135deg, rgba(15,23,42,.86), rgba(2,6,23,.78));
  box-shadow: 0 24px 80px rgba(0,0,0,.44);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}
.rf-client-guide summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font: 700 14px/1.35 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.01em;
}
.rf-client-guide summary::-webkit-details-marker { display: none; }
.rf-client-guide summary::after {
  content: "свернуть";
  float: right;
  color: rgba(248,250,252,.48);
  font-weight: 500;
  font-size: 11px;
}
.rf-client-guide:not([open]) summary::after { content: "открыть"; }
.rf-client-guide__body {
  border-top: 1px solid rgba(255,255,255,.10);
  padding: 0 18px 18px;
  color: rgba(248,250,252,.72);
  font: 500 13px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.rf-client-guide__body p { margin: 14px 0 10px; }
.rf-client-guide__body ul { margin: 0; padding-left: 18px; }
.rf-client-guide__body li { margin: 7px 0; }
@media (max-width: 720px) {
  .rf-client-guide { left: 12px; right: 12px; bottom: 12px; width: auto; border-radius: 20px; }
  .rf-client-guide__body { max-height: 220px; overflow: auto; }
}
