/* CMC Dispatch Hub — confirm-before-cancel, Undo toast, Recently cancelled (Oct 23 2026). Scoped cmc-cx-* / cmc-undo-*. */

/* ---------- confirm dialog (built on .complete-modal) ---------- */
.cmc-cx-backdrop { z-index: 160; animation: cmcCxFade .14s ease-out; }
.cmc-cx-modal { width: min(400px, 100%); padding: 22px 22px 18px; }
.cmc-cx-modal h3 { font-size: 18px; margin: 0 0 6px; }
.cmc-cx-modal .hint { margin: 0 0 18px; }
.cmc-cx-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.cmc-cx-actions .btn { min-width: 112px; height: 40px; }
@keyframes cmcCxFade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 480px) {
  .cmc-cx-backdrop { align-items: flex-end; }
  .cmc-cx-modal { border-radius: 18px 18px 14px 14px; }
  .cmc-cx-actions .btn { flex: 1 1 0; }
}
html[data-theme="maroon"] .cmc-cx-modal, html[data-theme="enterprise"] .cmc-cx-modal {
  background: #fff; color: #1f2937; border: 1px solid #e5e7eb; box-shadow: 0 24px 60px rgba(15, 23, 42, .22); }
html[data-theme="maroon"] .cmc-cx-backdrop, html[data-theme="enterprise"] .cmc-cx-backdrop { background: rgba(15, 23, 42, .42); }
html[data-theme="maroon"] .cmc-cx-modal h3 { color: #5c1a2e; font-family: 'Playfair Display', Georgia, serif; }
html[data-theme="enterprise"] .cmc-cx-modal h3 { color: #0f2f4f; }

/* ---------- Undo toast ---------- */
.cmc-undo-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150; transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; overflow: hidden;
  min-width: min(340px, 92vw); max-width: 92vw; border-radius: 14px;
  background: #1c1230; color: #f5f3ff; border: 1px solid rgba(216, 180, 254, .35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45); font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.cmc-undo-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.cmc-undo-msg { flex: 1 1 auto; }
.cmc-undo-btn {
  height: 34px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  letter-spacing: .02em; background: #e879f9; color: #1c1230; }
.cmc-undo-btn:disabled { opacity: .7; cursor: default; }
.cmc-undo-x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: inherit;
  opacity: .65; font-size: 18px; line-height: 1; cursor: pointer; }
.cmc-undo-x:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.cmc-undo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #e879f9; transform-origin: left center; }
html[data-theme="maroon"] .cmc-undo-toast { background: #fff; color: #3b0d1c; border-color: #ead7dd; box-shadow: 0 18px 40px rgba(92, 26, 46, .2); }
html[data-theme="maroon"] .cmc-undo-btn, html[data-theme="maroon"] .cmc-undo-bar { background: #7a1e3a; color: #fff; }
html[data-theme="enterprise"] .cmc-undo-toast { background: #0f2f4f; color: #fff; border-color: #0f2f4f; box-shadow: 0 18px 40px rgba(15, 47, 79, .3); }
html[data-theme="enterprise"] .cmc-undo-btn { background: #fff; color: #0f2f4f; }
html[data-theme="enterprise"] .cmc-undo-bar { background: #7cc4f5; }
@media (max-width: 480px) { .cmc-undo-toast { bottom: 16px; left: 12px; right: 12px; transform: translateY(16px); min-width: 0; max-width: none; }
  .cmc-undo-toast.is-on { transform: translateY(0); } }

/* ---------- Recently cancelled (today) ---------- */
.cmc-cancelled { margin-top: 14px; border-top: 1px dashed var(--line, rgba(216,180,254,.25)); padding-top: 10px; }
.cmc-cancelled.hidden { display: none; }
.cmc-cancelled > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted, #a78bfa); user-select: none; }
.cmc-cancelled > summary::-webkit-details-marker { display: none; }
.cmc-cancelled > summary::before { content: '›'; display: inline-block; width: 10px; font-size: 15px; line-height: 1; transition: transform .15s ease; }
.cmc-cancelled[open] > summary::before { transform: rotate(90deg); }
.cmc-cx-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: 0; background: rgba(148, 163, 184, .18); color: inherit; }
.cmc-cx-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cmc-cx-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px;
  border: 1px solid var(--line, rgba(216,180,254,.2)); background: rgba(148, 163, 184, .06); }
.cmc-cx-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmc-cx-when { font-size: 12px; font-weight: 700; color: var(--fg, #ede9fe); }
.cmc-cx-what { font-size: 12px; color: var(--muted, #a78bfa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmc-cx-item .cmc-cx-restore { height: 32px; padding: 0 14px; flex: 0 0 auto; }
html[data-theme="maroon"] .cmc-cx-item { background: #fbf6f7; border-color: #ead7dd; }
html[data-theme="maroon"] .cmc-cx-when { color: #3b0d1c; }
html[data-theme="maroon"] .cmc-cancelled > summary { color: #7a1e3a; }
html[data-theme="enterprise"] .cmc-cx-item { background: #f6f9fc; border-color: #dbe4ee; }
html[data-theme="enterprise"] .cmc-cx-when { color: #0f2f4f; }
html[data-theme="enterprise"] .cmc-cancelled > summary { color: #1d5a8a; }
