/* ── Toast ── */
#toast-container {
  position: fixed;
  right: 18px;
  top: calc(var(--topbar-height, 64px) + 12px);
  z-index: 1300;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 290px;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  animation: slideInRight 0.22s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

.toast .icon { font-size: 1rem; margin-top: 1px; }
.toast .message { color: var(--text); font-size: 0.87rem; line-height: 1.45; }
.toast .close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}
.toast .close:hover { opacity: 1; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 19, 39, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 14px;
  animation: fadeIn 0.18s ease;
}

.modal-card {
  width: min(560px, 96vw);
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: slideUp 0.22s ease;
}

.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #f8f6ff 0%, #ffffff 100%);
}

.modal-head h3, .modal-head h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 18px;
  max-height: min(70vh, 680px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--surface-muted);
}

/* ── Inline alerts ── */
.alert-inline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.alert-inline.error {
  border: 1px solid #ffd3d7;
  background: #fff3f4;
  color: #9f2730;
}

.alert-inline.warning {
  border: 1px solid #ffe1ae;
  background: #fff7e6;
  color: #8f5a00;
}

/* ── Role pills ── */
.role-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.role-admin  { background: #ede0ff; color: #5a2fa7; }
.role-editor { background: #ddeeff; color: #1a4fa0; }
.role-viewer { background: #eceef5; color: #4a5270; }

/* ── Skeleton ── */
.skeleton-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 14px;
}

.skeleton-line {
  height: 11px;
  border-radius: 6px;
}

.skeleton-line + .skeleton-line { margin-top: 8px; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-90 { width: 90%; }

/* ── Animations ── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  #toast-container { left: 10px; right: 10px; top: 10px; }
  .toast { min-width: 0; max-width: 100%; }
}
