:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 22px;
  --ui-space-6: 28px;
  --ui-control: 40px;
  --ui-btn: 38px;
  --ui-btn-sm: 32px;
  --ui-chip: 22px;
  --ui-page-top: 28px;
  --ui-page-x: 32px;
  --ui-panel-radius: var(--r-3, 16px);
  --ui-control-radius: 12px;
  --ui-label-size: 11px;
  --ui-table-head: 44px;
  --ui-row: var(--row-h, 56px);
}

html body .app-btn,
html body .btn {
  height: var(--ui-btn);
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

html body .app-btn--small,
html body .btn-sm {
  height: var(--ui-btn-sm);
  padding: 0 12px;
  font-size: 11.5px;
}

html body .app-tag,
html body .pill,
html body .chip {
  height: var(--ui-chip);
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.005em;
}

html body .app-tag {
  border: 0;
  background: var(--neutral-soft, var(--app-surface-2));
  color: var(--muted, var(--app-muted));
}

html body .app-card {
  border: 1px solid var(--line, var(--app-line));
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--shadow-1, var(--app-shadow));
  background: var(--surface, var(--app-surface));
}

html body .app-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line, var(--app-line));
}

html body .app-card__head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink, var(--app-ink));
}

html body .app-card__head p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, var(--app-muted));
}

html body .app-field > span,
html body .field > span,
html body .field span,
html body .lbl {
  font-size: var(--ui-label-size);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2, var(--app-ink-2));
}

html body .app-field input,
html body .app-field select,
html body .app-field textarea,
html body .field input,
html body .field select,
html body .field textarea,
html body .input,
html body .select,
html body .textarea {
  height: var(--ui-control);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--ui-control-radius);
  background: var(--surface-2, var(--app-surface-2));
  color: var(--ink, var(--app-ink));
  font-size: 13px;
}

html body .app-field textarea,
html body .field textarea,
html body .textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.5;
}

html body .app-field input:focus,
html body .app-field select:focus,
html body .app-field textarea:focus,
html body .field input:focus,
html body .field select:focus,
html body .field textarea:focus,
html body .input:focus,
html body .select:focus,
html body .textarea:focus {
  outline: none;
  border-color: var(--accent, var(--app-accent));
  background: var(--surface, var(--app-surface));
  box-shadow: 0 0 0 3px var(--accent-soft, var(--app-accent-soft));
}

html body .app-form-grid,
html body .form-grid {
  gap: 12px;
}

html body .pagehead h1 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.028em;
}

html body .pagehead p,
html body .ph-sub {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

html body .workspace {
  padding: var(--ui-page-top) var(--ui-page-x) 40px;
}

html body .workspace > .topbar {
  margin: 0 calc(-1 * var(--ui-page-x)) 0;
}

html body .workspace__main {
  padding: 0 0 64px;
}

html body .page + .page,
html body app-card + .app-card {
  margin-top: 18px;
}

html body .panel + .panel,
html body .panel + .app-card,
html body .app-card + .panel,
html body .app-card + .app-card,
html body .split + .split,
html body .kpis + .split,
html body .split + .card,
html body .card + .split {
  margin-top: 18px;
}

html body .data-table thead th,
html body .app-table thead th,
html body .tbl th {
  height: var(--ui-table-head);
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

html body .data-table tbody td,
html body .app-table tbody td,
html body .tbl td {
  height: var(--ui-row);
  padding: 6px 14px;
  color: var(--ink-2);
  font-size: 13px;
}

html body .navpanel__area-label,
html body .side-group,
html body .nav-group-title,
html body .navpanel__group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

html body .navpanel__link,
html body .nav-item {
  min-height: 36px;
  border-radius: 10px;
}

html body .kpi,
html body .stat-card {
  border-radius: var(--ui-panel-radius);
}

html body .navpanel__nav {
  padding-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

html body .nav,
html body .navpanel__nav {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent);
}

html body .stat-card b,
html body .kpi-value {
  font-variant-numeric: tabular-nums;
}

html body .skeleton {
  display: inline-block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: ui-skeleton 1.2s linear infinite;
}

html body .skeleton--value {
  width: 64px;
  height: 20px;
}

@keyframes ui-skeleton {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
