.btn {
  min-height: 38px;
  border: 1px solid var(--glass-border, var(--line, rgba(148, 163, 184, .22)));
  border-radius: 13px;
  background: rgba(255, 255, 255, .055);
  color: var(--text-secondary, var(--sub, #cbd5e1));
  font: 800 12px var(--font, Inter, ui-sans-serif, system-ui, sans-serif);
  padding: 9px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.btn:hover {
  border-color: rgba(86, 224, 194, .32);
  color: var(--text-primary, var(--text, #f8fafc));
  background: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid rgba(86, 224, 194, .42);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: .48;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent, #56e0c2), var(--accent-2, var(--accent2, #6c63ff)));
  color: #02111a;
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 14px 30px rgba(86, 224, 194, .16);
}

.btn-primary:hover {
  color: #02111a;
  box-shadow: 0 16px 34px rgba(86, 224, 194, .20);
}

.btn-secondary,
.btn-ghost {
  background: transparent;
  border-color: var(--glass-border, var(--line, rgba(148, 163, 184, .22)));
  color: var(--text-secondary, var(--sub, #cbd5e1));
}

.btn-danger {
  background: rgba(251, 113, 133, .12);
  border-color: rgba(251, 113, 133, .26);
  color: #fecdd3;
}

.btn-icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.mini-btn {
  min-height: 30px;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 11px;
}

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.badge::before,
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: .75;
}

.badge-success,
.badge-green {
  color: #bbf7d0;
  background: rgba(52, 211, 153, .13);
  border-color: rgba(52, 211, 153, .24);
}

.badge-warning,
.badge-yellow,
.badge-orange {
  color: #fde68a;
  background: rgba(251, 191, 36, .13);
  border-color: rgba(251, 191, 36, .24);
}

.badge-danger,
.badge-red {
  color: #fecdd3;
  background: rgba(251, 113, 133, .13);
  border-color: rgba(251, 113, 133, .24);
}

.badge-info,
.badge-blue {
  color: #bfdbfe;
  background: rgba(96, 165, 250, .13);
  border-color: rgba(96, 165, 250, .24);
}

.badge-neutral,
.badge-gray,
.badge-muted {
  color: #cbd5e1;
  background: rgba(148, 163, 184, .12);
  border-color: rgba(148, 163, 184, .18);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: block;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 150;
  display: none;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid var(--glass-border, var(--line, rgba(148, 163, 184, .22)));
  border-radius: 22px;
  background: rgba(15, 23, 42, .96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
  transform: translate(-50%, -50%) scale(.96);
  opacity: 0;
  -webkit-overflow-scrolling: touch;
}

.modal.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-dialog {
  width: 100%;
}

.modal-head {
  padding: 18px;
  border-bottom: 1px solid var(--glass-border, var(--line, rgba(148, 163, 184, .22)));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--text-muted, var(--muted, #94a3b8));
  font-size: 12px;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 13px;
}

.modal-actions {
  padding: 15px 18px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--glass-border, var(--line, rgba(148, 163, 184, .22)));
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
}

@media (max-width: 760px) {
  .btn {
    min-height: 40px;
  }

  .btn-icon {
    width: 40px;
    min-width: 40px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .modal-actions {
    align-items: stretch;
  }

  .modal-actions .btn {
    flex: 1 1 100%;
  }
}
