:root {
  --teb-bg: #f5f6f8;
  --teb-surface: #ffffff;
  --teb-surface-muted: #fafafa;
  --teb-text: #1f2430;
  --teb-text-muted: #646b78;
  --teb-border: #dde1e7;
  --teb-accent: #ffa500;
  --teb-accent-dark: #d88900;
  --teb-success: #2e7d32;
  --teb-danger: #c62828;
  --teb-info: #117a8b;
  --teb-radius: 8px;
}

body {
  background: var(--teb-bg) !important;
  color: var(--teb-text) !important;
}

.content-wrapper,
.wrapper {
  background: var(--teb-bg) !important;
}

.content {
  padding: 18px 22px !important;
}

.main-header,
.navbar,
.navbar-light {
  border-bottom: 3px solid var(--teb-accent) !important;
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.08);
}

.main-sidebar,
.sidebar {
  background: var(--teb-surface) !important;
  border-right: 1px solid var(--teb-border);
}

.nav-sidebar .nav-link {
  border-radius: 6px;
  color: var(--teb-text) !important;
}

.nav-sidebar .nav-link:hover {
  background: #f0f2f5 !important;
  color: var(--teb-text) !important;
}

.nav-sidebar .nav-link.active {
  background: var(--teb-accent) !important;
  color: #ffffff !important;
  font-weight: 700;
}

.card,
.small-box,
.info-box {
  border-radius: var(--teb-radius) !important;
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.08) !important;
}

.bg-gray-dark,
.card.bg-gray-dark {
  background: var(--teb-surface) !important;
  color: var(--teb-text) !important;
}

.card {
  border: 1px solid var(--teb-border) !important;
}

.card-header {
  background: linear-gradient(90deg, #ffffff, #fafafa) !important;
  border-bottom: 2px solid var(--teb-accent) !important;
  color: var(--teb-text) !important;
  font-weight: 700;
}

.card-title {
  color: var(--teb-text) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.card-body {
  background: var(--teb-surface) !important;
}

.small-box {
  border: 1px solid var(--teb-border) !important;
  overflow: hidden;
}

.btn,
.form-control,
.selectize-input,
.selectize-dropdown {
  border-radius: 6px !important;
}

.btn-primary,
.btn-warning,
.bg-orange {
  background-color: var(--teb-accent) !important;
  border-color: var(--teb-accent) !important;
  color: #1a1814 !important;
  font-weight: 700;
}

.btn-primary:hover,
.btn-warning:hover {
  background-color: var(--teb-accent-dark) !important;
  border-color: var(--teb-accent-dark) !important;
}

.teb-info-tip {
  color: var(--teb-accent);
  cursor: help;
  display: inline-flex;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
}

.teb-info-tip__content {
  background: var(--teb-text);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(31, 36, 48, 0.22);
  color: #ffffff;
  display: none;
  font-size: 12px;
  font-weight: 400;
  left: 50%;
  line-height: 1.45;
  max-width: 320px;
  min-width: 220px;
  padding: 10px 12px;
  position: absolute;
  top: 24px;
  transform: translateX(-50%);
  z-index: 10000;
}

.teb-info-tip:hover .teb-info-tip__content {
  display: block;
}

.teb-sidebar-section {
  background: var(--teb-surface);
  border: 1px solid var(--teb-border);
  border-radius: var(--teb-radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.teb-sidebar-section__header {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  padding: 10px 12px;
}

.teb-sidebar-section__title {
  color: var(--teb-text);
  font-size: 13px;
  font-weight: 700;
}

.teb-sidebar-section__arrow {
  color: var(--teb-text-muted);
  font-size: 11px;
  transition: transform 0.2s;
}

.teb-sidebar-section__header.is-collapsed .teb-sidebar-section__arrow {
  transform: rotate(-90deg);
}

.teb-sidebar-section__body {
  border-top: 1px solid var(--teb-border);
  padding: 10px 12px;
}

.teb-sidebar-section__body.is-collapsed {
  display: none;
}

.teb-metric-box {
  align-items: center;
  background: var(--teb-surface);
  border: 1px solid var(--teb-border);
  border-left: 4px solid var(--teb-accent);
  border-radius: var(--teb-radius);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.teb-metric-box--success {
  border-left-color: var(--teb-success);
}

.teb-metric-box--danger {
  border-left-color: var(--teb-danger);
}

.teb-metric-box--info {
  border-left-color: var(--teb-info);
}

.teb-metric-box__label {
  color: var(--teb-text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.teb-metric-box__value {
  color: var(--teb-text);
  font-size: 18px;
  font-weight: 700;
}

.teb-metric-box__unit {
  color: var(--teb-text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}

.teb-result-card {
  background: var(--teb-surface);
  border: 1px solid var(--teb-border);
  border-radius: var(--teb-radius);
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.08);
  margin-bottom: 16px;
}

.teb-result-card__header {
  align-items: center;
  border-bottom: 1px solid var(--teb-border);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.teb-result-card__title {
  color: var(--teb-text);
  font-size: 14px;
  font-weight: 700;
}

.teb-result-card__body {
  padding: 14px;
}

.teb-workflow-panel {
  background: var(--teb-surface);
  border: 1px solid var(--teb-border);
  border-left: 4px solid var(--teb-accent);
  border-radius: var(--teb-radius);
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.06);
  margin: 0 0 14px;
  padding: 12px 14px;
}

.teb-workflow-panel__title {
  align-items: center;
  color: var(--teb-text);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  list-style: none;
  margin: 0;
}

.teb-workflow-panel__title::-webkit-details-marker {
  display: none;
}

.teb-workflow-panel__title::after {
  color: var(--teb-text-muted);
  content: "Развернуть";
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

.teb-workflow-panel[open] .teb-workflow-panel__title {
  margin-bottom: 8px;
}

.teb-workflow-panel[open] .teb-workflow-panel__title::after {
  content: "Свернуть";
}

.teb-workflow-panel__steps {
  color: var(--teb-text-muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding-left: 20px;
}

.teb-workflow-panel__steps li {
  margin: 2px 0;
}

.teb-empty-state {
  align-items: center;
  background: var(--teb-surface-muted);
  border: 1px dashed var(--teb-border);
  border-radius: var(--teb-radius);
  color: var(--teb-text-muted);
  display: flex;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
}

.teb-empty-state__icon {
  color: var(--teb-accent);
  font-size: 18px;
}

.teb-empty-state__title {
  color: var(--teb-text);
  font-size: 13px;
  font-weight: 700;
}

.teb-empty-state__text {
  font-size: 12px;
  line-height: 1.45;
}

.teb-before-value {
  color: var(--teb-text);
  font-weight: 600;
}

.teb-after-value {
  color: var(--teb-danger);
  font-weight: 700;
}

.teb-before-after-value {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.08;
}

.teb-before-after-value .teb-before-value,
.teb-before-after-value .teb-after-value {
  display: block;
  white-space: nowrap;
}

.main-sidebar .shiny-input-container {
  margin-bottom: 8px !important;
}

.main-sidebar .control-label {
  font-size: 11px !important;
  line-height: 1.15 !important;
  margin-bottom: 2px !important;
}

.main-sidebar .irs {
  height: 34px !important;
  margin-top: -2px !important;
}

.main-sidebar .irs-line,
.main-sidebar .irs-bar {
  height: 4px !important;
  top: 18px !important;
}

.main-sidebar .irs-handle {
  height: 14px !important;
  top: 13px !important;
  width: 14px !important;
}

.main-sidebar .irs-single,
.main-sidebar .irs-min,
.main-sidebar .irs-max {
  font-size: 10px !important;
  line-height: 1 !important;
  top: 0 !important;
}
