.nav-dropdown { display: none; }
.nav-dropdown.open { display: block; }

/* Motion: everything animated in the app respects the OS "reduce motion"
   setting. The one exception is the loading spinner, which is essential
   feedback rather than decoration. */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }
/* Spinners are drawn as a CSS ring instead of the Font Awesome glyph. The
   glyph sits slightly off-centre inside its box at small sizes (up to ~2px at
   12px), so it wobbled as it turned; a bordered circle is centred on its own
   box by construction, so it spins in place. Applies to every <i class="spinner">
   whatever icon class it also carries. */
i.spinner {
  display: inline-block; box-sizing: border-box; width: 1em; height: 1em;
  border: 0.15em solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -0.125em; transform-origin: 50% 50%;
}
i.spinner::before { content: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation: spin 1.5s linear infinite !important; animation-iteration-count: infinite !important; }
}

/* ===================== Toasts (global, transient, non-critical) ===================== */
#toast-container { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 0.6rem; background: #1e293b; color: #fff; font-size: 0.825rem; padding: 0.6rem 0.9rem; border-radius: 0.6rem; box-shadow: 0 12px 32px -12px rgba(0,0,0,0.5); opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

/* ===================== In-app confirm dialog (native <dialog>) ===================== */
dialog.cc-dialog { border: none; border-radius: 0.75rem; padding: 1.25rem; max-width: 24rem; width: 92%; box-shadow: 0 24px 60px -16px rgba(0,0,0,0.45); color: #0f172a; }
dialog.cc-dialog::backdrop { background: rgba(15,23,42,0.5); }
dialog.cc-dialog .cc-dialog-title { font-weight: 600; color: #0f172a; margin-bottom: 0.4rem; font-size: 1rem; }
dialog.cc-dialog .cc-dialog-msg { color: #475569; font-size: 0.875rem; margin-bottom: 1.1rem; line-height: 1.5; white-space: pre-line; }
dialog.cc-dialog .cc-dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.cc-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 500; padding: 0.45rem 0.7rem; border-radius: 0.5rem; cursor: pointer; border: 1px solid transparent; transition: all .15s; white-space: nowrap; }
.cc-btn:disabled { opacity: 0.6; cursor: default; }
.cc-btn-primary { background: #6366f1; color: #fff; }
.cc-btn-primary:hover { background: #4f46e5; }
.cc-btn-danger { background: #dc2626; color: #fff; }
.cc-btn-danger:hover { background: #b91c1c; }
.cc-btn-outline { border-color: #e2e8f0; color: #334155; background: #fff; }
.cc-btn-outline:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* Submit buttons while a form is in flight (set by the global submit handler). */
button[data-busy] { opacity: 0.7; cursor: progress; }
