/* ---------- modals ---------- */
body.modal-open {
  overflow: hidden;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-fade 0.2s ease-out both;
}
@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 55%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.modal-panel--wide {
  max-width: 720px;
}
@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.modal-title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.modal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.modal-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.btn-icon-sm {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn-icon-sm:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
}

/* ---------- tabs ---------- */
.tab-row {
  display: inline-flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1rem;
  width: 100%;
}
.tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

