:root {
  --ds-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --ds-bg: #ffffff;
  --ds-surface: #fdfcff;
  --ds-border: rgba(167, 139, 250, 0.35);
  --ds-text: rgba(76, 29, 149, 0.92);
  --ds-text-soft: rgba(76, 29, 149, 0.7);
  --ds-primary: #9333ea;
  --ds-primary-dark: #7e22ce;
  --ds-accent: #2563eb;
  --ds-success: #16a34a;
  --ds-warn: #d97706;
  --ds-danger: #dc2626;
  --ds-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  --ds-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.06);
  --ds-control-h: 34px;
  --ds-radius: 10px;
  --ds-radius-sm: 6px;
  --ds-gap: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ds-font-sans);
  color: var(--ds-text);
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(37, 99, 235, 0.08));
  overflow-x: hidden;
}

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

.ds-wrap { max-width: 1180px; margin: 0 auto; padding: 16px; overflow-x: hidden; }
.ds-root {
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--ds-border);
  border-radius: 16px;
  box-shadow: var(--ds-shadow);
  padding: 14px;
  overflow-x: hidden;
}

.ds-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ds-title { margin: 0; font-size: 26px; line-height: 1.1; font-weight: 900; }
.ds-subtitle { margin: 6px 0 0; color: var(--ds-text-soft); font-size: 12px; font-weight: 650; }
.ds-chip { border: 1px solid var(--ds-border); background: rgba(255,255,255,0.8); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.ds-gradient-text {
  background: linear-gradient(90deg, var(--ds-primary-dark), #db2777, var(--ds-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.ds-grid > * { min-width: 0; }
@media (max-width: 980px) { .ds-grid { grid-template-columns: 1fr; } }

.ds-card {
  border: 1px solid var(--ds-border);
  background: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}
.ds-card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.ds-card h3 { margin: 12px 0 6px; font-size: 13px; font-weight: 900; }
.ds-font-help { margin: 0; color: var(--ds-text-soft); font-size: 12px; line-height: 1.45; font-weight: 650; }
.ds-font-normal { margin: 0; color: rgba(107, 114, 128, 0.95); font-size: 13px; line-height: 1.45; font-weight: 400; }
.ds-font-link { color: var(--ds-accent); font-size: 13px; line-height: 1.45; font-weight: 400; text-decoration: none; }

.ds-field { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.ds-label { font-size: 12px; color: var(--ds-text-soft); font-weight: 800; }
.ds-input, .ds-select, .ds-textarea {
  width: 100%;
  min-height: var(--ds-control-h);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: var(--ds-radius);
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
}
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: 0;
  border-color: rgba(147,51,234,.9);
  box-shadow: 0 0 0 3px rgba(147,51,234,.16);
}
.ds-input:disabled { background: rgba(241, 245, 249, 0.9); color: var(--ds-text-soft); }

.ds-btn {
  border: 0;
  border-radius: var(--ds-radius);
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
  transition: .16s ease;
}
.ds-btn-primary { background: linear-gradient(90deg, var(--ds-primary), var(--ds-accent)); color: #fff; }
.ds-btn-primary:hover { box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25); transform: translateY(-1px); }
.ds-btn-secondary { background: rgba(147, 51, 234, 0.08); color: var(--ds-text); border: 1px solid rgba(147, 51, 234, 0.25); }
.ds-btn-secondary:hover { background: rgba(147, 51, 234, 0.14); }

.ds-main-btn {
  min-height: var(--ds-control-h);
  height: var(--ds-control-h);
  border: 1px solid rgba(148,163,184,.55);
  border-radius: var(--ds-radius-sm);
  background: #fff;
  color: var(--ds-text-soft);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}
.ds-main-btn:hover { background: rgba(147, 51, 234, 0.08); color: var(--ds-text); }
.ds-main-btn-primary { background: linear-gradient(90deg, var(--ds-primary), var(--ds-accent)); color: #fff; border-color: transparent; }
.ds-main-btn-primary:hover { box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25); color: #fff; }
.ds-main-btn-danger { border-color: rgba(220, 38, 38, 0.35); color: rgba(220, 38, 38, 0.92); background: rgba(220, 38, 38, 0.08); }
.ds-main-btn-danger:hover { background: rgba(220, 38, 38, 0.14); color: rgba(185, 28, 28, 0.96); }
.ds-main-btn-icon { width: var(--ds-control-h); min-width: var(--ds-control-h); flex: 0 0 var(--ds-control-h); padding: 0; }

.ds-lucide {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ds-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 980px) { .ds-modal-grid { grid-template-columns: 1fr; } }
.ds-modal-actions { margin-top: 10px; display: flex; justify-content: flex-end; gap: 8px; }

.ds-control-row { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-start; flex-wrap: wrap; width: fit-content; max-width: 100%; }

.ds-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: rgba(126, 34, 206, 0.9);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.ds-menu-item:hover { background: rgba(147, 51, 234, 0.08); color: var(--ds-text); }
.ds-menu-item.active { background: linear-gradient(90deg, var(--ds-primary), var(--ds-accent)); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24); }
.ds-menu-group-title {
  padding: 10px 10px 4px;
  color: var(--ds-text-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ds-menu-divider {
  height: 1px;
  background: rgba(167, 139, 250, 0.25);
  margin: 6px 0;
  border: 0;
}

.ds-toast-stack { display: grid; gap: 6px; }
.ds-toast {
  border: 1px solid;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.92);
}
.ds-toast-success { border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.1); color: rgba(21, 128, 61, 0.96); }
.ds-toast-error { border-color: rgba(220, 38, 38, 0.35); background: rgba(220, 38, 38, 0.1); color: rgba(185, 28, 28, 0.96); }
.ds-toast-text { flex: 1 1 auto; }
