:root {
  color-scheme: light;
  --brand-accent: #ff7f57 !important;
  --brand-secondary: #7b61a5 !important;
  --brand-dark: #3e424f !important;
  --brand-soft: #efefef !important;
  --brand-white: #ffffff !important;
  --brand-panel: #ffffff !important;
  --brand-rose: #ad6d8e !important;
  --brand-yellow: #edb818 !important;
  --brand-blue-soft: #a0b2c0 !important;
  --brand-blue-muted: #6f8c9f !important;
  --brand-gradient: #ff7f57 !important;

  --bg: #efefef !important;
  --panel: #ffffff !important;
  --card: #ffffff !important;
  --surface: #ffffff !important;
  --dark-surface: #3e424f !important;
  --border: rgba(62, 66, 79, .10) !important;
  --text: #3e424f !important;
  --muted: rgba(62, 66, 79, .62) !important;
  --text-muted: rgba(62, 66, 79, .62) !important;
  --accent: #ff7f57 !important;
  --accent-2: #7b61a5 !important;
  --green: var(--brand-secondary) !important;
  --orange: #ff7f57 !important;
  --red: #7b61a5 !important;
  --line: rgba(62, 66, 79, .12) !important;
  --shadow: 0 18px 45px rgba(62, 66, 79, .08) !important;
  --focus-ring: 0 0 0 3px rgba(255, 127, 87, .20) !important;
}

* {
  box-sizing: border-box;
}

body {
  background: #efefef !important;
  color: var(--text) !important;
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

button,
.nav a.primary,
.links a {
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 800;
}

button.secondary,
.nav a,
.links select,
button.secondary-btn {
  background: transparent !important;
  color: rgba(62, 66, 79, .62) !important;
  border-color: transparent !important;
}

button,
.nav a,
.links a {
  min-height: 38px;
  line-height: 1.2;
  transition: transform .16s ease, opacity .16s ease, border-color .16s ease, color .16s ease;
}

button:hover,
.nav a:hover,
.links a:hover {
  opacity: .92;
  transform: translateY(-1px);
}

.topbar,
header {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1px solid rgba(62, 66, 79, .10) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.topbar .muted,
header .sub {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 127, 87, .72) !important;
  box-shadow: var(--focus-ring) !important;
  outline: none;
}

a {
  color: #3e424f;
}

section,
.card,
.summary-card,
.kpi,
.filter-panel,
.form-card,
.data-card,
.logic-card,
.empty-state {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1px solid rgba(62, 66, 79, .10) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.wrap,
body {
  padding-left: max(24px, env(safe-area-inset-left)) !important;
  padding-right: max(24px, env(safe-area-inset-right)) !important;
}

h1,
h2,
h3,
.kpi .val,
.pnl-step strong,
.relation-total,
.relation-value {
  color: #3e424f !important;
}

label,
.muted,
.sub,
th,
.hint,
.footer,
.footer a,
.filter-field label,
.kpi label,
.pnl-step label {
  color: rgba(62, 66, 79, .62) !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  color: #3e424f !important;
  border-color: rgba(62, 66, 79, .12) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(62, 66, 79, .38) !important;
}

.badge,
.delta,
.health-pill,
.status,
.note,
pre,
.sample {
  background: #efefef !important;
  color: rgba(62, 66, 79, .72) !important;
  border-color: rgba(62, 66, 79, .10) !important;
}

.badge.prod,
.badge.sandbox,
.badge.active,
.badge.ok,
.health-pill::before,
.relation-bar span,
.insight {
  border-color: rgba(255, 127, 87, .34) !important;
}

.badge.prod::before,
.badge.sandbox::before,
.badge.active::before,
.badge.ok::before {
  background: #ff7f57 !important;
}

.status.ok,
.insight {
  border-left-color: #ff7f57 !important;
}

.status.err {
  border-left-color: #7b61a5 !important;
}

button.danger,
.badge.err,
.badge.inactive {
  background: rgba(123, 97, 165, .12) !important;
  color: #7b61a5 !important;
}

.kpi.primary,
tr.selected,
.relation-bar span {
  background: #ffffff !important;
}

.kpi.primary label,
.kpi.primary .val,
.kpi.primary .hint {
  color: #3e424f !important;
}

.relation-bar,
tfoot td,
.pnl-step,
.logic-card,
.sample,
pre {
  background: #efefef !important;
}

.relation-bar {
  background: #d9dde3 !important;
}

.relation-bar span {
  background: #6f8c9f !important;
}

td,
th {
  border-bottom-color: rgba(62, 66, 79, .08) !important;
}

.pnl-step.positive strong,
.badge.active,
.badge.ok {
  color: #3e424f !important;
}

.delta.up {
  color: #ff7f57 !important;
}

.delta.down,
.badge.err {
  color: #7b61a5 !important;
}

.pnl-step.negative strong {
  color: #3e424f !important;
}

.health-pill::before,
.badge.prod::before,
.badge.sandbox::before,
.badge.active::before,
.badge.ok::before {
  background: #ff7f57 !important;
}

.ai-insights-badge {
  background: #ff7f57 !important;
  border-color: #ff7f57 !important;
  color: #ffffff !important;
}

.ai-insights-badge::before {
  background: #ffffff !important;
}

.ai-insights-card {
  background: #f3f3f3 !important;
  border-color: rgba(62, 66, 79, .10) !important;
  color: #3e424f !important;
}

.ai-insights-card h2,
.ai-insights-card .sub,
.ai-insights-card .insight {
  color: #3e424f !important;
}

.ai-insights-card .insight {
  background: #ffffff !important;
  border-left-color: #ff7f57 !important;
}

button.export-btn {
  min-height: 30px !important;
  padding: 6px 10px !important;
  background: #efefef !important;
  border: 1px solid rgba(62, 66, 79, .10) !important;
  color: rgba(62, 66, 79, .72) !important;
  font-size: .74rem !important;
  font-weight: 700 !important;
}
