*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--cx-canvas-deep); }
button, input, select, textarea { font: inherit; }

.cx-modern {
  color: var(--cx-text);
  font: 400 var(--cx-text-md)/1.5 var(--cx-font);
}
.cx-modern h1, .cx-modern h2, .cx-modern h3, .cx-modern p { margin-top: 0; }
.cx-modern h1 { font-size: clamp(1.8rem, 3vw, var(--cx-text-3xl)); line-height: 1.06; letter-spacing: -.045em; }
.cx-modern h2 { font-size: var(--cx-text-xl); line-height: 1.16; letter-spacing: -.03em; }
.cx-modern h3 { font-size: var(--cx-text-lg); line-height: 1.25; }
.cx-modern :focus-visible { outline: 3px solid rgba(143, 196, 239, .54); outline-offset: 2px; }
.cx-muted { color: var(--cx-text-muted); }
.cx-number { font-variant-numeric: tabular-nums; }
.cx-stack { display: flex; flex-direction: column; gap: var(--cx-space-4); }
.cx-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--cx-space-3); }
.cx-between { justify-content: space-between; }

.cx-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--cx-radius-xl);
  padding: var(--cx-space-5);
}
.cx-kpi-label { color: var(--cx-text-muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cx-kpi-value { margin: 10px 0 5px; font-size: 28px; line-height: 1.05; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.cx-kpi-context { color: var(--cx-success); font-size: var(--cx-text-xs); }
.cx-kpi-context--danger { color: var(--cx-danger); }

.cx-btn {
  min-height: var(--cx-control-height);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-md);
  background: rgba(159, 175, 202, .07);
  color: var(--cx-text);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: var(--cx-text-sm);
  font-weight: 650;
  transition: background var(--cx-duration-fast) var(--cx-ease), border-color var(--cx-duration-fast) var(--cx-ease), transform var(--cx-duration-fast) var(--cx-ease);
}
.cx-btn:hover { background: rgba(159, 175, 202, .14); border-color: var(--cx-border-strong); }
.cx-btn:active { transform: translateY(1px); }
.cx-btn--primary { border-color: rgba(232, 176, 75, .34); background: linear-gradient(135deg, var(--cx-accent-400), #d99d31); color: var(--cx-brand-950); box-shadow: 0 10px 28px rgba(232, 176, 75, .16); }
.cx-btn--primary:hover { background: linear-gradient(135deg, #f6d48e, var(--cx-accent-500)); }
.cx-btn--ghost { background: transparent; border-color: transparent; }
.cx-btn--danger { color: var(--cx-danger); background: var(--cx-danger-soft); border-color: rgba(255, 146, 153, .28); }
.cx-btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.cx-icon-btn { width: var(--cx-control-height); padding: 0; }

.cx-field { display: grid; gap: 6px; }
.cx-label { color: var(--cx-text); font-size: var(--cx-text-sm); font-weight: 650; }
.cx-input {
  width: 100%;
  min-height: var(--cx-control-height);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-md);
  background: rgba(15, 31, 61, .70);
  color: var(--cx-text);
  padding: 8px 12px;
}
.cx-input:hover { border-color: var(--cx-border-strong); }
.cx-input[aria-invalid="true"] { border-color: var(--cx-danger); }
.cx-help { margin: 0; color: var(--cx-text-muted); font-size: var(--cx-text-xs); }
.cx-error { margin: 0; color: var(--cx-danger); font-size: var(--cx-text-xs); }

.cx-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 999px; padding: 4px 8px; background: var(--cx-info-soft); color: var(--cx-info); font-size: 10px; font-weight: 700; }
.cx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.cx-badge--success { background: var(--cx-success-soft); color: var(--cx-success); }
.cx-badge--warning { background: var(--cx-warning-soft); color: var(--cx-warning); }
.cx-badge--danger { background: var(--cx-danger-soft); color: var(--cx-danger); }
.cx-badge--accent { background: var(--cx-accent-soft); color: var(--cx-accent-400); }

.cx-alert { border: 1px solid var(--cx-border); border-left: 3px solid var(--cx-info); border-radius: var(--cx-radius-lg); padding: 13px 15px; background: var(--cx-info-soft); }
.cx-alert--success { border-left-color: var(--cx-success); background: var(--cx-success-soft); }
.cx-alert--warning { border-left-color: var(--cx-warning); background: var(--cx-warning-soft); }
.cx-alert--danger { border-left-color: var(--cx-danger); background: var(--cx-danger-soft); }
.cx-alert p { margin: 3px 0 0; color: var(--cx-text-muted); font-size: var(--cx-text-xs); }

.cx-table-wrap { overflow: auto; border: 1px solid var(--cx-border); border-radius: var(--cx-radius-xl); background: rgba(15, 31, 61, .62); backdrop-filter: blur(var(--cx-effect-blur)); box-shadow: var(--cx-effect-shadow); }
.cx-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.cx-table th { padding: 12px 15px; background: rgba(159, 175, 202, .05); border-bottom: 1px solid var(--cx-border); color: var(--cx-brand-300); font-size: 9px; text-transform: uppercase; letter-spacing: .10em; text-align: left; }
.cx-table td { padding: 15px; border-bottom: 1px solid var(--cx-border); font-size: var(--cx-text-sm); }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-table tbody tr:hover { background: rgba(159, 175, 202, .045); }
.cx-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.cx-health { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; }
.cx-health::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cx-success); box-shadow: 0 0 0 3px var(--cx-success-soft); }
.cx-health--warning::before { background: var(--cx-warning); box-shadow: 0 0 0 3px var(--cx-warning-soft); }
.cx-health--danger::before { background: var(--cx-danger); box-shadow: 0 0 0 3px var(--cx-danger-soft); }

.cx-kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.cx-kanban-column { min-width: 220px; border: 1px solid var(--cx-border); border-radius: var(--cx-radius-xl); background: rgba(10, 22, 40, .55); padding: 12px; }
.cx-kanban-head { display: flex; justify-content: space-between; margin: 2px 3px 11px; color: var(--cx-brand-300); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.cx-deal { border: 1px solid var(--cx-border); border-radius: var(--cx-radius-lg); background: linear-gradient(145deg, var(--cx-surface-strong), var(--cx-surface)); padding: 13px; margin-top: 8px; box-shadow: 0 10px 24px rgba(3, 9, 23, .16); }
.cx-deal--priority { border-color: rgba(232, 176, 75, .34); box-shadow: 0 10px 28px rgba(232, 176, 75, .07); }

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