/* Orbit uses the original brand colours, with separate ink and action colours for contrast. */
:root {
  --orbit-deep: #123b48;
  --orbit-aqua: #22d0cb;
  --orbit-ice: #ecf7f8;
  --orbit-slate: #51707a;
  --ink: #103442;
  --ink-2: var(--orbit-deep);
  --surface: #fff;
  --canvas: var(--orbit-ice);
  --text: #112f39;
  --muted: var(--orbit-slate);
  --line: #cfe2e6;
  --border: var(--line);
  --primary: #006e73;
  --primary-2: #087c89;
  --accent: #007a70;
  --theme-focus: #007a80;
  --shadow: 0 5px 22px #123b480c;
  --orbit-tint: #f5fbfb;
  --orbit-soft: #ddf5f4;
  --orbit-line-strong: #769098;
  --orbit-action: #006e73;
  --orbit-action-hover: #00585f;
  --orbit-on-action: #fff;
  --orbit-shell: #0c303b;
  --orbit-nav-ink: #e9f9f9;
  --orbit-nav-muted: #accdd3;
  --orbit-nav-hover: #1b4753;
  --orbit-nav-active: #006870;
  --orbit-positive: #08765c;
  --orbit-negative: #b4314c;
  --orbit-attention: #805818;
  --orbit-chart-sales: #007d84;
  --orbit-chart-profit: #15855e;
  --orbit-map-water: #e3f4f7;
  --orbit-map-land: #cbdee2;
  --orbit-map-region: #e4eeea;
  --orbit-map-boundary: #9db7bd;
  --orbit-map-grid: #bed7db;
  --orbit-map-empty: #839ba4;
  --orbit-map-warehouse: #356ac5;
  --tc-bg-fff: var(--surface);
  --tc-bg-f7f8fc: var(--orbit-tint);
  --tc-bg-f8f9fc: var(--orbit-tint);
  --tc-bg-f4f6fa: var(--orbit-tint);
  --tc-bg-eef1f7: var(--orbit-soft);
  --tc-bg-f0f2f8: var(--orbit-tint);
  --tc-bg-f0efff: var(--orbit-soft);
  --tc-bg-f0eeff: var(--orbit-soft);
  --tc-bg-f6f5ff: var(--orbit-tint);
  --tc-bg-f7f6ff: var(--orbit-tint);
  --tc-bg-f1f5ff: var(--orbit-tint);
  --tc-bg-e9edff: var(--orbit-soft);
  --tc-line-e7eaf3: var(--line);
  --tc-line-e5e9f2: var(--line);
  --tc-line-edf0f5: var(--line);
  --tc-line-dfe3ee: var(--line);
  --tc-line-c4bdff: var(--orbit-line-strong);
  --tc-line-7c72f5: var(--theme-focus);
  --tc-line-7663ed: var(--primary);
  --tc-fg-5440c1: var(--primary);
  --tc-fg-5746bb: var(--primary);
  --tc-fg-5546b7: var(--primary);
  --tc-fg-4358bf: var(--primary);
  --tc-fg-6558f5: var(--primary);
  --tc-fg-5148cf: var(--primary);
}

:root[data-theme="dark"] {
  --ink: #091e27;
  --ink-2: #183b45;
  --surface: #142f39;
  --canvas: #0a2029;
  --text: #eaf7f8;
  --muted: #b1ccd1;
  --line: #32545d;
  --primary: #76e5df;
  --primary-2: #8ac9f0;
  --accent: #7fe7c9;
  --theme-focus: #90efea;
  --shadow: 0 7px 24px #03121855;
  --orbit-tint: #102934;
  --orbit-soft: #1d434b;
  --orbit-line-strong: #769ba5;
  --orbit-action: #76e5df;
  --orbit-action-hover: #9af0ea;
  --orbit-on-action: #092a32;
  --orbit-shell: #09232d;
  --orbit-nav-ink: #eaf7f8;
  --orbit-nav-muted: #a8cbd1;
  --orbit-nav-hover: #1a414b;
  --orbit-nav-active: #006771;
  --orbit-positive: #82e8c7;
  --orbit-negative: #ffa6b8;
  --orbit-attention: #f6cc8d;
  --orbit-chart-sales: #55d9d2;
  --orbit-chart-profit: #82e8af;
  --orbit-map-water: #102a36;
  --orbit-map-land: #254753;
  --orbit-map-region: #33575c;
  --orbit-map-boundary: #527581;
  --orbit-map-grid: #33515a;
  --orbit-map-empty: #a4b9bf;
  --orbit-map-warehouse: #91c2ff;
  --tc-translucent: #142f39;
  --control-bg: #193843;
  --control-text: #eaf7f8;
  --control-border: #769ba5;
  --control-hover: #254954;
  --control-selected: var(--orbit-action);
  --control-selected-text: var(--orbit-on-action);
  --control-focus: #ffe3a8;
  --control-hover-border: #b1d1d6;
  --control-selected-border: #aff4ef;
  --control-selected-hover: var(--orbit-action-hover);
  --control-field: #122d37;
  --control-placeholder: #b4cbd0;
  --control-disabled: #142d36;
  --control-disabled-text: #a0bcc3;
  --control-disabled-border: #50737d;
}

html, body {
  background-color: var(--canvas);
  color: var(--text);
}
:root[data-theme] {
  accent-color: var(--primary);
}

:is(.brand-mark, .legal-mark) {
  object-fit: contain;
  flex: 0 0 auto;
  display: block;
  background: none;
  box-shadow: none;
}
.brand-mark { width: 42px; height: 42px; }
.brand-name { font-weight: 800; letter-spacing: -.045em; }
.brand-caption { margin-left: 62px; letter-spacing: .06em; }
.sidebar,
:root[data-theme="dark"] .sidebar {
  color: var(--orbit-nav-ink);
  background: linear-gradient(158deg, var(--orbit-deep), var(--orbit-shell) 66%);
  border-right: 1px solid #7fe9e326;
  scrollbar-color: #6e9aa3 var(--orbit-shell);
}
.sidebar :is(.brand-caption, .nav-heading, .sync-label, .nav-icon) {
  color: var(--orbit-nav-muted);
}
.sidebar .nav-item {
  min-height: 41px;
  border-radius: 9px;
  color: var(--orbit-nav-ink);
}
.sidebar .nav-item:hover { background: var(--orbit-nav-hover); }
.sidebar .nav-item.active {
  background: var(--orbit-nav-active);
  color: #fff;
  box-shadow: inset 3px 0 var(--orbit-aqua);
}
.sidebar .nav-item.active .nav-icon { color: #c5fcf8; }
.sidebar :is(.nav-item, .brand-home, .sync-card button):focus-visible {
  outline: 2px solid #9ef5f0;
  outline-offset: 2px;
}
.sidebar .sync-card {
  background: #ffffff0c;
  border-color: #9adddf37;
}
.sidebar .nav-group.ai-nav {
  background: #5cdad712;
  border-color: #61d4cf66;
  box-shadow: inset 2px 0 #63e4dd;
}
.sidebar .ai-nav .nav-heading,
.sidebar .ai-nav .nav-heading::before { color: #aef4ef; }

.topbar {
  background: var(--surface);
  box-shadow: 0 1px 0 #123b4809;
  backdrop-filter: none;
}
.topbar h1 { font-weight: 800; letter-spacing: -.045em; }
.topbar .eyebrow { color: var(--muted); }
.topbar .menu-button { color: var(--text); }
.toolbar { background: var(--orbit-tint); }
:root[data-theme="dark"] .compact-field { background: var(--orbit-tint); border-color: var(--line); }
.toolbar .date-range,
.toolbar .compare-control { color: var(--muted); }
.eyebrow { color: var(--primary); }
.section-head h2 { font-weight: 780; letter-spacing: -.035em; }

.primary-button,
:root[data-theme="dark"] .primary-button,
.profile-button,
:root[data-theme="dark"] .profile-button {
  background: var(--orbit-action);
  color: var(--orbit-on-action);
  box-shadow: none;
}
.primary-button:hover:not(:disabled),
.profile-button:hover:not(:disabled) { background: var(--orbit-action-hover); }
.secondary-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--orbit-line-strong);
}
.secondary-button:hover:not(:disabled) { background: var(--orbit-tint); }
:root:not([data-theme="dark"]) :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--theme-focus);
  outline-offset: 3px;
}
:root:not([data-theme="dark"]) :is(.segmented, .auth-tabs, .geo-tabs) button:is(.active, [aria-pressed="true"]),
:root:not([data-theme="dark"]) .oc-grains button[aria-pressed="true"] {
  background: var(--orbit-action);
  color: var(--orbit-on-action);
  box-shadow: none;
}
:root:not([data-theme="dark"]) .theme-options button[aria-pressed="true"] {
  background: var(--orbit-action);
  color: var(--orbit-on-action);
  border-color: var(--orbit-action);
}
:root:not([data-theme="dark"]) :is(.auth-form input:not([type="radio"], [type="checkbox"]), .auth-form select, .theme-select) {
  border-color: var(--orbit-line-strong);
}

:is(.panel, .metric-card, .setting-card) {
  border-color: var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-header { border-color: var(--line); }
.metric-label, .metric-sub { color: var(--muted); }
.metric-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric-info { color: var(--muted); background: var(--orbit-soft); }
.metric-card::after { background: none; }
.overview-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.overview-metrics .metric-card {
  min-width: 0;
  min-height: 108px;
  padding: 12px 13px;
  border-radius: 11px;
}
.overview-metrics .metric-card::after {
  inset: auto -29px -32px auto;
  width: 90px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--primary) 23%, transparent);
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--primary) 6%, transparent);
  transform: rotate(-30deg);
  pointer-events: none;
}
.overview-metrics .metric-label { align-items: flex-start; gap: 6px; line-height: 1.35; }
.overview-metrics .metric-info { flex: 0 0 18px; }
.overview-metrics .metric-label > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.overview-metrics .metric-label > span:first-child::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--orbit-soft);
}
.overview-metrics .metric-value {
  margin-top: 7px;
  font-size: clamp(19px, 1.55vw, 24px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}
.overview-metrics :is(.metric-sub, .trend) { margin-top: 5px; font-size: 11px; line-height: 1.4; }
@media (max-width: 1020px) {
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .overview-metrics { grid-template-columns: minmax(0, 1fr); }
}
.trend.up { color: var(--orbit-positive); }
.trend.down { color: var(--orbit-negative); }
.trend.neutral { color: var(--muted); }

.app-shell table {
  font-variant-numeric: tabular-nums;
}
.app-shell thead th {
  background-color: var(--orbit-tint);
  color: var(--text);
  border-color: var(--line);
}
.app-shell :is(.table-panel, .p129-table, .fbo-table-scroll, .fbsw-table-wrap) tbody td {
  border-color: var(--line);
}
.app-shell :is(.table-panel, .p129-table, .fbsw-table-wrap) tbody tr:hover {
  background-color: var(--orbit-tint);
}
.badge.blue { color: var(--primary); background: var(--orbit-soft); }
.badge.amber { color: var(--orbit-attention); }
.chart-label { fill: var(--muted); }
:root[data-theme] .oc-tooltip {
  color: #eaf7f8;
  background: var(--orbit-deep);
  border-color: #527581;
}
:root[data-theme] .oc-tooltip > strong { color: #fff; }
:root[data-theme="dark"] .oc-metric.selected {
  background: var(--orbit-soft) !important;
}

:root[data-theme] .geo-map-wrap { background: var(--orbit-map-water); }
:root[data-theme] .geo-land { fill: var(--orbit-map-land); stroke: var(--orbit-map-boundary); }
:root[data-theme] .geo-land[data-country="RUS"] { fill: var(--orbit-map-region); }
:root[data-theme] .geo-grid { stroke: var(--orbit-map-grid); }
.geo-route { stroke: var(--primary); }
.geo-stock-summary { background: var(--orbit-tint); }
.fbo-map-line.transit { stroke: var(--primary); }
.fbo-map-legend .transit { color: var(--primary); }
.fbo-map-truck.transit .fbo-map-truck-bg { fill: var(--orbit-deep); }
.fbo-map-end:not(.origin) { fill: var(--primary); }

.ai-person { --ai-tint: var(--orbit-soft); }
.ai-person-avatar { background: var(--orbit-action); color: var(--orbit-on-action); }
.aida-card { border-color: var(--line); }
:is(.fbsw-heading, .fbo-head, .p129-heading, .aida-head, .admin-head) h2 { letter-spacing: -.035em; }

.auth-screen {
  width: min(1400px, calc(100% - 64px));
  margin-inline: auto;
  padding: 27px 0 32px;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 22px 28px;
  align-items: start;
  overflow: visible;
  background: transparent;
}
.auth-screen::after { display: none; }
.auth-screen .auth-brand {
  position: static;
  grid-column: 1 / -1;
  max-width: none;
}
.auth-brand strong { font-weight: 800; letter-spacing: -.045em; }
.auth-screen > .auth-card {
  width: 100%;
  margin: 0;
  padding: clamp(23px, 3.1vw, 36px);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card .auth-form-title { font-weight: 800; letter-spacing: -.04em; }
.auth-card :is(.auth-divider, .auth-row .check-line) { color: var(--muted); }
.auth-card .auth-message:empty { min-height: 0; }
:root[data-theme="dark"] .auth-card .auth-tabs { background: var(--orbit-tint); }
:root[data-theme="dark"] .auth-screen .text-button:not(:disabled):not([aria-disabled="true"]) {
  background: none !important;
  border-color: transparent !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}
.auth-screen .text-button:hover { text-decoration: underline; }
.auth-screen > .auth-aside {
  isolation: isolate;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(23px, 3.3vw, 45px);
  overflow: hidden;
  border: 1px solid #4c929a55;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--orbit-deep), var(--orbit-shell) 70%, #14515a);
  color: #f2fdfd;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: -10px -42px auto auto;
  width: min(65%, 460px);
  aspect-ratio: 3 / 2;
  z-index: -1;
  background: url("orbit-lines-v135.svg") center / contain no-repeat;
  opacity: .68;
  pointer-events: none;
}
.auth-aside h1 {
  max-width: 21ch;
  font-size: clamp(30px, 3.65vw, 56px);
  line-height: 1.06;
  letter-spacing: -.052em;
  font-weight: 800;
  margin: 20px 0 12px;
}
.auth-aside .auth-hero133-lead { color: #d2e9ec; margin: 0 0 23px; }
.auth-aside .auth-pill {
  color: #c8fffc;
  border-color: #96dfe273;
  background: #123b48;
}
.auth-aside .auth-feature b {
  border-color: #6dc4c469;
  background: #123b48;
  color: #a7f4ee;
}
.auth-aside .auth-feature small { color: #d2e9ec; }
.auth-trial133 {
  color: var(--text);
  border-color: var(--line);
  background: var(--orbit-soft);
}
.auth-preview {
  color: var(--text);
  background: var(--orbit-tint);
  border-color: #78aab0;
  box-shadow: 0 15px 36px #041b2370;
}
.auth-preview-nav { background: var(--orbit-deep); color: var(--orbit-nav-muted); }
.auth-preview-nav .selected { color: var(--orbit-aqua); }
.preview-demo-badge { color: var(--primary); background: var(--orbit-soft); }
:is(.auth-preview-bar, .preview-kpis > div, .preview-sales-chart, .preview-products, .auth-preview figcaption) {
  background: var(--surface);
  border-color: var(--line);
}
:is(.preview-kpis span, .preview-kpis small, .preview-chart-axis, .preview-products > div:first-child, .auth-preview figcaption) {
  color: var(--muted);
}
.preview-kpis > div:nth-child(2) strong { color: var(--orbit-positive); }
.preview-kpis strong { font-variant-numeric: tabular-nums; }
.preview-sales-chart i { background: var(--orbit-chart-sales); }
.auth-pricing133 { box-shadow: var(--shadow); margin-top: 0; }
.auth-footer { background: var(--surface); }

:root[data-theme] .account-plan-badge {
  color: var(--primary);
  border-color: var(--orbit-line-strong);
  background: var(--orbit-soft);
}
.plan132-choice input { accent-color: var(--primary); }
.plan132-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--orbit-tint);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.plan132-choice:has(input:focus-visible) { outline-color: var(--theme-focus); }
.account-plan-badge[data-plan="galaktika"] { box-shadow: none; }
.plans133-card.is-current {
  background: var(--orbit-tint);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.plans133-table .is-current { background: var(--orbit-soft); }
:root[data-theme] :is(.plans133-check, .plans133-card.is-current .plans133-marker, .plans133-card.is-current .plans133-card-foot, .plans133-table th small) {
  color: var(--primary);
}
.plans133-orbit {
  position: relative;
  color: var(--primary);
  background: var(--orbit-soft);
  border-color: var(--line);
  box-shadow: none;
  font-size: 0;
  flex-shrink: 0;
}
.plans133-orbit::before, .plans133-orbit::after { content: ""; position: absolute; }
[data-plan-card="sputnik"] .plans133-orbit::before {
  width: 16px;
  height: 9px;
  transform: rotate(-35deg);
  border: 1px solid currentColor;
  border-radius: 50%;
}
[data-plan-card="sputnik"] .plans133-orbit::after {
  width: 5px;
  height: 5px;
  top: 7px;
  right: 6px;
  background: currentColor;
  border-radius: 50%;
}
[data-plan-card="planeta"] .plans133-orbit::before {
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 50%;
}
[data-plan-card="planeta"] .plans133-orbit::after {
  width: 20px;
  height: 8px;
  transform: rotate(-25deg);
  border: 1px solid currentColor;
  border-radius: 50%;
}
[data-plan-card="sistema"] .plans133-orbit::before {
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
[data-plan-card="sistema"] .plans133-orbit::after {
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor 2px, transparent 3px);
}
[data-plan-card="galaktika"] .plans133-orbit::before,
[data-plan-card="galaktika"] .plans133-orbit::after {
  width: 21px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: rotate(-34deg);
}
[data-plan-card="galaktika"] .plans133-orbit::after { transform: rotate(34deg); }
.plans133-ai-value, .plans133-trial-state { background: var(--orbit-tint); border-color: var(--line); }

@media (min-width: 1250px) {
  .preview-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1101px) {
  .app-shell { grid-template-columns: 244px minmax(0, 1fr); }
}
@media (max-width: 1050px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); width: min(760px, calc(100% - 36px)); }
  .auth-screen > .auth-card { max-width: 520px; margin-inline: auto; }
}
@media (max-width: 580px) {
  .auth-screen { width: calc(100% - 28px); gap: 15px; padding-top: 17px; }
  .auth-screen > .auth-aside { padding: 22px 17px; }
  .auth-aside::before { width: 69%; opacity: .38; }
  .auth-aside h1 { font-size: clamp(27px, 7.8vw, 40px); }
  .auth-preview-nav img { width: 19px; height: 19px; }
  .preview-kpis strong { font-size: clamp(12px, 3.5vw, 18px); }
  .overview-metrics .metric-card { min-height: 0; }
}
