:root {
  color-scheme: dark;
  --bg: #080d0c;
  --surface: #101716;
  --surface-raised: #141d1b;
  --surface-hover: #18221f;
  --surface-soft: #0c1312;
  --border: #26332f;
  --border-soft: #1d2926;
  --text: #edf5f2;
  --text-secondary: #a8b6b2;
  --text-muted: #7f918c;
  --green: #32d5a4;
  --green-soft: rgba(50, 213, 164, 0.12);
  --green-border: rgba(50, 213, 164, 0.28);
  --red: #ff6576;
  --red-soft: rgba(255, 101, 118, 0.12);
  --red-border: rgba(255, 101, 118, 0.3);
  --amber: #e5bc45;
  --amber-soft: rgba(229, 188, 69, 0.12);
  --amber-border: rgba(229, 188, 69, 0.3);
  --blue: #76a9fa;
  --blue-soft: rgba(118, 169, 250, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 236px;
  --topbar-height: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 74% -12%, rgba(50, 213, 164, 0.075), transparent 30rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.mono,
.metric-value,
.table-number,
.timestamp,
.telegram-code,
.status-value {
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.muted {
  color: var(--text-muted);
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.warning {
  color: var(--amber) !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  border-bottom: 1px solid rgba(38, 51, 47, 0.85);
  background: rgba(8, 13, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  width: var(--sidebar-width);
  height: 100%;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 0 24px;
  border-right: 1px solid var(--border-soft);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--green-border);
  border-radius: 9px;
  color: var(--green);
  background: linear-gradient(145deg, rgba(50, 213, 164, 0.16), rgba(50, 213, 164, 0.03));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.03em;
}

.brand-product {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topbar-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 27px;
}

.environment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(127, 145, 140, 0.1);
}

.status-dot.is-ok {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), 0 0 18px rgba(50, 213, 164, 0.38);
}

.status-dot.is-warning {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.topbar-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.freshness {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 5px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.freshness strong {
  color: var(--text-secondary);
  font-weight: 650;
}

.account-select {
  min-width: 138px;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237f918c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--surface);
}

.icon-button:hover {
  border-color: #344640;
  color: var(--text);
  background: var(--surface-hover);
}

.icon-button.is-loading .icon {
  animation: spin 0.8s linear infinite;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 25px 14px 18px;
  border-right: 1px solid var(--border-soft);
  background: rgba(10, 16, 15, 0.74);
}

.nav-label {
  margin: 0 11px 10px;
  color: #667873;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 590;
  transition: 120ms ease;
}

.nav-link:hover {
  color: var(--text-secondary);
  background: rgba(24, 34, 31, 0.65);
}

.nav-link.is-active {
  border-color: var(--green-border);
  color: var(--text);
  background: linear-gradient(90deg, rgba(50, 213, 164, 0.12), rgba(50, 213, 164, 0.035));
}

.nav-link.is-active .icon {
  color: var(--green);
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 15px 11px 2px;
  border-top: 1px solid var(--border-soft);
}

.user-label {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.logout-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 11px;
}

.logout-button:hover {
  color: var(--text);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 39px) 34px 52px;
}

.view {
  display: none;
  width: min(100%, 1540px);
  margin: 0 auto;
}

.view.is-active {
  display: block;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 1.05;
}

.page-description {
  max-width: 640px;
  margin: 11px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.page-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.context-pill,
.status-pill,
.table-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(16, 23, 22, 0.86);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.context-pill {
  min-height: 32px;
  padding: 0 12px;
}

.context-pill.is-ok {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-soft);
}

.context-pill.is-warning {
  border-color: var(--amber-border);
  color: var(--amber);
  background: var(--amber-soft);
}

.context-pill.is-error {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-soft);
}

.status-pill,
.table-pill {
  min-height: 24px;
  padding: 0 9px;
}

.status-pill.is-ok,
.table-pill.is-ok {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.is-warning,
.table-pill.is-warning {
  border-color: var(--amber-border);
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.is-error,
.table-pill.is-error {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-soft);
}

.alert-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--amber-soft), rgba(16, 23, 22, 0.7));
}

.alert.is-error {
  border-color: var(--red-border);
  background: linear-gradient(90deg, var(--red-soft), rgba(16, 23, 22, 0.7));
}

.alert-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--amber);
  background: var(--amber-soft);
}

.alert.is-error .alert-icon {
  color: var(--red);
  background: var(--red-soft);
}

.alert-title {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.alert-detail {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card,
.panel {
  border: 1px solid var(--border-soft);
  background: linear-gradient(150deg, rgba(20, 29, 27, 0.9), rgba(13, 20, 18, 0.94));
}

.metric-card {
  min-width: 0;
  min-height: 118px;
  padding: 17px 17px 15px;
  border-radius: var(--radius);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 690;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.metric-value {
  overflow: hidden;
  margin-top: 17px;
  color: var(--text);
  font-size: clamp(18px, 1.65vw, 25px);
  font-weight: 680;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-meta {
  min-height: 14px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.64fr);
  gap: 12px;
  margin-top: 12px;
}

.dashboard-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.panel-header {
  display: flex;
  min-height: 63px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.012em;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
}

.panel-body {
  padding: 19px;
}

.chart-wrap {
  position: relative;
  height: 278px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(127, 145, 140, 0.12);
  stroke-width: 1;
}

.chart-area {
  fill: url(#equity-fill);
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.service-list {
  display: grid;
  gap: 9px;
}

.service-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 55px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(8, 13, 12, 0.38);
}

.service-row .status-dot {
  margin: 0 3px;
}

.service-name {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 680;
}

.service-detail {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-value {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 25px 17px 22px;
}

.pipeline-stage {
  position: relative;
  min-width: 0;
  text-align: center;
}

.pipeline-stage::before,
.pipeline-stage::after {
  position: absolute;
  z-index: 0;
  top: 8px;
  width: 50%;
  height: 1px;
  background: var(--border);
  content: "";
}

.pipeline-stage::before {
  left: 0;
}

.pipeline-stage::after {
  right: 0;
}

.pipeline-stage:first-child::before,
.pipeline-stage:last-child::after {
  display: none;
}

.pipeline-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 17px;
  height: 17px;
  margin: 0 auto 11px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--border);
  box-shadow: 0 0 0 1px var(--border);
}

.pipeline-stage.is-complete .pipeline-dot {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green-border);
}

.pipeline-stage.is-active .pipeline-dot {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-border), 0 0 15px rgba(229, 188, 69, 0.26);
}

.pipeline-stage.is-error .pipeline-dot {
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red-border);
}

.pipeline-stage.is-complete::before,
.pipeline-stage.is-complete::after,
.pipeline-stage.is-active::before,
.pipeline-stage.is-error::before {
  background: rgba(50, 213, 164, 0.42);
}

.pipeline-label {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-stage.is-active .pipeline-label,
.pipeline-stage.is-error .pipeline-label {
  color: var(--text-secondary);
}

.pipeline-time {
  display: block;
  margin-top: 5px;
  color: #61716c;
  font-size: 8px;
}

.allocation-layout {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.donut {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.donut-center span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.allocation-list {
  display: grid;
  gap: 12px;
}

.allocation-row {
  display: grid;
  grid-template-columns: 42px minmax(70px, 1fr) 44px 44px;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.asset-symbol {
  color: var(--text-secondary);
  font-weight: 730;
}

.allocation-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-soft);
}

.allocation-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--green);
}

.allocation-weight {
  color: var(--text-secondary);
  text-align: right;
}

.allocation-delta {
  color: var(--text-muted);
  text-align: right;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.data-table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 710;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(29, 41, 38, 0.72);
  color: var(--text-secondary);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: rgba(24, 34, 31, 0.34);
}

.data-table .table-primary {
  color: var(--text);
  font-weight: 680;
}

.data-table .table-number {
  text-align: right;
}

.data-table th.table-number {
  text-align: right;
}

.empty-row td {
  height: 94px;
  color: var(--text-muted);
  text-align: center;
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
}

.detail-list {
  display: grid;
  margin: 0;
}

.detail-row {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row dt {
  color: var(--text-muted);
  font-size: 10px;
}

.detail-row dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 640;
  text-align: right;
}

.signals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 19px;
}

.signal-card {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(8, 13, 12, 0.38);
}

.signal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signal-name {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 710;
}

.signal-allocation {
  margin-top: 17px;
  font-size: 23px;
  font-weight: 670;
  letter-spacing: -0.035em;
}

.signal-meta {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.incident-list,
.audit-list {
  display: grid;
}

.incident-item,
.audit-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--border-soft);
}

.incident-item:last-child,
.audit-item:last-child {
  border-bottom: 0;
}

.timeline-marker {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.timeline-marker.is-error {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-soft);
}

.timeline-marker.is-warning {
  border-color: var(--amber-border);
  color: var(--amber);
  background: var(--amber-soft);
}

.timeline-title {
  margin: 1px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 690;
}

.timeline-copy {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.timeline-time {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.market-tabs {
  display: flex;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(8, 13, 12, 0.45);
}

.market-tab {
  min-height: 33px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  font-size: 10px;
  font-weight: 680;
}

.market-tab:hover {
  color: var(--text-secondary);
}

.market-tab.is-active {
  color: var(--text);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px var(--border);
}

.widget-shell {
  position: relative;
  height: min(710px, calc(100vh - 228px));
  min-height: 520px;
  background: #0b1110;
}

.market-widget {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1110;
}

.widget-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  margin: auto;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.market-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.market-disclaimer .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--amber);
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: var(--surface-hover);
  border-radius: 5px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(237, 245, 242, 0.045), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.88fr) minmax(440px, 1.12fr);
}

.auth-aside {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px clamp(32px, 5vw, 78px);
  border-right: 1px solid var(--border-soft);
  background:
    linear-gradient(rgba(8, 13, 12, 0.25), rgba(8, 13, 12, 0.78)),
    radial-gradient(circle at 32% 42%, rgba(50, 213, 164, 0.13), transparent 28rem),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(50, 213, 164, 0.025) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(50, 213, 164, 0.025) 80px),
    #0b1210;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
}

.auth-brand .brand-mark {
  width: 37px;
  height: 37px;
}

.auth-aside-copy {
  position: relative;
  z-index: 1;
  max-width: 530px;
  margin: auto 0;
  padding: 68px 0;
}

.auth-aside-copy h1 {
  max-width: 510px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 69px);
  font-weight: 660;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.auth-aside-copy p {
  max-width: 465px;
  margin: 22px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-flow-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 34px;
}

.auth-flow-step {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(16, 23, 22, 0.8);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-flow-arrow {
  color: #455550;
}

.auth-aside-footer {
  color: #61716c;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 50% 35%, rgba(50, 213, 164, 0.05), transparent 24rem),
    var(--bg);
}

.auth-card {
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(20, 29, 27, 0.97), rgba(12, 19, 17, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.auth-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--green-border);
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
}

.auth-card-icon.is-centered {
  margin: 0 auto;
}

.auth-complete-eyebrow {
  margin-top: 22px;
}

.section-gap {
  margin-top: 12px;
}

.allocation-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--border-soft);
}

.allocation-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--border-soft);
}

.allocation-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green);
}

.allocation-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green);
}

.donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-base {
  fill: none;
  stroke: var(--border-soft);
  stroke-width: 12;
}

.donut-segment {
  fill: none;
  stroke-width: 12;
}

.auth-card h2 {
  margin: 24px 0 0;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.auth-card-copy {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 25px 0;
}

.auth-progress-step {
  height: 3px;
  border-radius: 999px;
  background: var(--border);
}

.auth-progress-step.is-active,
.auth-progress-step.is-complete {
  background: var(--green);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 730;
}

.primary-button {
  border: 1px solid var(--green);
  color: #04110d;
  background: var(--green);
}

.primary-button:hover {
  background: #42e2b1;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
}

.secondary-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.button-block {
  width: 100%;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.auth-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--text-muted);
}

.telegram-state {
  text-align: center;
}

.telegram-logo {
  display: grid;
  width: 47px;
  height: 47px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(118, 169, 250, 0.28);
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
}

.telegram-code {
  margin: 23px 0 12px;
  color: var(--text);
  font-size: 31px;
  font-weight: 680;
  letter-spacing: 0.16em;
}

.auth-timer {
  color: var(--text-muted);
  font-size: 10px;
}

.auth-status {
  min-height: 18px;
  margin: 13px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.auth-status.is-error {
  color: var(--red);
}

.auth-status.is-success {
  color: var(--green);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1260px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .view-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  :root {
    --sidebar-width: 0px;
  }

  .topbar {
    position: sticky;
  }

  .brand {
    width: auto;
    padding: 0 16px;
    border-right: 0;
  }

  .brand-copy,
  .environment,
  .freshness {
    display: none;
  }

  .topbar-main {
    justify-content: flex-end;
    padding: 0 14px 0 0;
  }

  .sidebar {
    position: sticky;
    z-index: 35;
    top: var(--topbar-height);
    display: block;
    width: 100%;
    height: 52px;
    overflow-x: auto;
    padding: 7px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(8, 13, 12, 0.94);
    backdrop-filter: blur(18px);
  }

  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    width: max-content;
  }

  .nav-link {
    min-height: 37px;
    padding: 0 12px;
    font-size: 11px;
  }

  .nav-link .icon {
    width: 15px;
    height: 15px;
  }

  .main {
    margin-left: 0;
    padding: 31px 20px 46px;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }
}

@media (max-width: 680px) {
  .account-select {
    min-width: 116px;
    max-width: 140px;
  }

  .main {
    padding-right: 13px;
    padding-left: 13px;
  }

  .page-header {
    display: block;
  }

  .page-header h1 {
    font-size: 30px;
  }

  .page-context {
    justify-content: flex-start;
    margin-top: 17px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 108px;
    padding: 14px;
  }

  .metric-value {
    margin-top: 14px;
    font-size: 20px;
  }

  .dashboard-grid.equal,
  .service-list,
  .signals-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
  }

  .pipeline {
    grid-template-columns: 1fr;
    padding: 16px 19px;
  }

  .pipeline-stage {
    display: grid;
    min-height: 43px;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    text-align: left;
  }

  .pipeline-stage::before,
  .pipeline-stage::after {
    top: 0;
    left: 8px;
    width: 1px;
    height: 50%;
  }

  .pipeline-stage::after {
    top: 17px;
  }

  .pipeline-stage:first-child::before,
  .pipeline-stage:last-child::after {
    display: none;
  }

  .pipeline-dot {
    margin: 0;
  }

  .pipeline-label {
    padding-top: 2px;
  }

  .pipeline-time {
    margin: 2px 0 0;
  }

  .allocation-layout {
    grid-template-columns: 1fr;
  }

  .donut {
    margin: 0 auto;
  }

  .incident-item,
  .audit-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .timeline-time {
    grid-column: 2;
  }

  .market-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .market-tab {
    flex: 0 0 auto;
  }

  .widget-shell {
    height: 620px;
    min-height: 0;
  }

  .auth-main {
    padding: 18px;
  }

  .auth-card {
    padding: 25px 21px;
  }
}

@media (max-width: 430px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 96px;
  }

  .metric-value {
    font-size: 22px;
  }

  .panel-body {
    padding: 15px;
  }

  .allocation-row {
    grid-template-columns: 38px minmax(55px, 1fr) 40px;
  }

  .allocation-delta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
