/* Flow 4: campaigns listing, wizard, detail and approvals. */

.cmp-filters { display: grid; gap: 12px; }
.cmp-filters .mz-toolbar .field { min-width: 150px; }
.cmp-filters .mz-toolbar__grow { min-width: 220px; }
.cmp-filterline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: .84rem; color: var(--muted); }

.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cmp-grid > .mz-empty { grid-column: 1 / -1; }
.cmp-card { position: relative; display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--glass-bg); box-shadow: var(--glass-shadow); }
.cmp-card.is-live { box-shadow: var(--glass-shadow), inset 0 0 0 2px var(--brand-500); }
.cmp-card.is-live::after { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, transparent, var(--brand-500), transparent); background-size: 200% 100%; animation: cmp-sweep 2.4s linear infinite; }
@keyframes cmp-sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .cmp-card.is-live::after { animation: none; } }
.cmp-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cmp-card__head h3 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.25; }
.cmp-card__head h3 a { color: var(--ink) !important; text-decoration: none; }
.cmp-card__head h3 a:hover { text-decoration: underline; }
.cmp-card__head p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.cmp-card__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.cmp-card__nums div { display: grid; gap: 1px; }
.cmp-card__nums dt { font-size: .7rem; font-weight: 700; color: var(--muted); }
.cmp-card__nums dd { margin: 0; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.cmp-card__pct { margin: -4px 0 0; font-size: .84rem; color: var(--muted); }
.cmp-card__pct strong { color: var(--ink); }
.cmp-livecount { display: inline-flex; align-items: center; gap: 4px; color: var(--tone-live); font-weight: 700; }
.cmp-livecount .lucide { width: 13px; height: 13px; }
.cmp-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmp-card__foot .row { gap: 6px; }
.cmp-card__foot .btn .lucide { width: 15px; height: 15px; }

/* Wizard */
.cmp-fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cmp-fieldset legend { margin-bottom: 8px; padding: 0; font-size: .88rem; font-weight: 650; color: var(--ink); }
.cmp-drop { display: grid; justify-items: center; gap: 6px; padding: 30px 20px; border: 2px dashed var(--field-border); border-radius: 18px; background: var(--surface-2); text-align: center; transition: border-color .15s, background .15s; }
.cmp-drop.is-over { border-color: var(--brand-500); background: var(--hover-bg); }
.cmp-drop > .lucide { width: 32px; height: 32px; color: var(--link); }
.cmp-drop p { margin: 0; }
.cmp-drop__pick { color: var(--link); font-weight: 700; text-decoration: underline; cursor: pointer; }
.cmp-drop input:focus-visible + p, .cmp-drop:has(input:focus-visible) { outline: 3px solid var(--info); outline-offset: 3px; }
.cmp-drop__alt { justify-content: center; margin-top: 6px; }
.cmp-filebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.cmp-filebar > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.cmp-filebar .lucide { width: 18px; height: 18px; color: var(--link); flex: none; }
.cmp-preview { max-height: 360px; }
.cmp-preview .mz-table th { padding: 6px; }
.cmp-preview .mz-table td { white-space: nowrap; }
.cmp-preview td.is-skipped { color: var(--muted); text-decoration: line-through; opacity: .6; }
.cmp-colbtn { display: grid; gap: 3px; width: 100%; min-width: 120px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--control-bg); color: var(--ink); text-align: left; cursor: context-menu; }
.cmp-colbtn:hover { border-color: var(--brand-200); }
.cmp-colbtn__name { font-size: .82rem; font-weight: 750; letter-spacing: 0; text-transform: none; }
.cmp-colbtn__type { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; color: var(--muted); }
.cmp-colbtn__type .lucide { width: 12px; height: 12px; }
.cmp-col--phone .cmp-colbtn { border-color: var(--brand-500); background: var(--hover-bg); }
.cmp-col--phone .cmp-colbtn__type { color: var(--link); }
.cmp-col--skip .cmp-colbtn { border-style: dashed; opacity: .75; }
.cmp-validate-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cmp-validate-head h3 { margin: 0 0 4px; }
.cmp-report { display: grid; gap: 12px; }
.cmp-report__rows { max-height: 240px; }
.cmp-chip { display: inline-flex; margin: 2px 0; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; font-weight: 600; color: var(--ink); }
.cmp-mapsum dd { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }

/* Start dialog */
.cmp-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.cmp-template { display: flex; gap: 8px; }
.cmp-template input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.cmp-compliance { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.cmp-compliance h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; }
.cmp-compliance h3 .lucide { width: 18px; height: 18px; color: var(--link); }
.cmp-compliance__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.cmp-compliance .mz-stat { background: var(--panel-bg); box-shadow: none; }
.cmp-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .86rem; }
.cmp-list li { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); }
.cmp-list .lucide { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.cmp-list--bad li { color: var(--tone-bad); font-weight: 600; }
.cmp-list--bad .lucide { color: var(--tone-bad); }
.cmp-list code { font-size: .74rem; }
.cmp-ok { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--tone-good); font-size: .86rem; font-weight: 600; }
.cmp-ok .lucide { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.mz-dialog__foot .mz-foot-note { display: inline-flex; align-items: center; gap: 6px; }
.mz-dialog__foot .mz-foot-note .lucide { width: 15px; height: 15px; }

/* Approval email */
.cmp-email { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--solid-bg, #fff); font-size: .86rem; }
.cmp-email header { display: grid; gap: 3px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cmp-email header p { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.cmp-email header span { display: inline-block; min-width: 62px; color: var(--muted); font-weight: 650; }
.cmp-email__body { display: grid; gap: 10px; padding: 14px; }
.cmp-email__body p, .cmp-email__body li { margin: 0; color: var(--ink); }
.cmp-email__body ul { margin: 0; padding-left: 18px; }
.cmp-email__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmp-email__actions .btn { text-decoration: none; }

/* Detail */
.cmp-head { align-items: flex-start; }
.cmp-head h1 { overflow-wrap: anywhere; }
.cmp-head__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.cmp-head__actions { display: grid; justify-items: end; gap: 10px; }
.cmp-head__actions .row { flex-wrap: wrap; justify-content: flex-end; }
.cmp-prevnext .btn .lucide { width: 15px; height: 15px; }
.cmp-info { display: grid; gap: 16px; }
.cmp-info__kv { gap: 14px 18px; }
.cmp-info__kv dd { font-weight: 650; }
.cmp-info__progress { display: grid; gap: 6px; }
.cmp-info__progress p { margin: 0; }
.cmp-grow { flex: 1; display: grid; gap: 8px; }
[data-banner] .mz-notice { align-items: center; }
[data-banner] .mz-notice .row { margin-left: auto; gap: 8px; }
[data-banner]:empty { display: none; }
[data-exec]:empty { display: none; }
.cmp-exec { display: grid; gap: 14px; }
.cmp-exec header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.main-content .cmp-exec h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.2rem; }
.cmp-exec .mz-stat { background: var(--surface-2); box-shadow: none; }
.cmp-exec .mz-notice .btn { flex: none; }
.cmp-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(217, 45, 74, .5); animation: cmp-ping 1.6s ease-out infinite; }
@keyframes cmp-ping { 70% { box-shadow: 0 0 0 8px rgba(217, 45, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 45, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .cmp-dot { animation: none; } }
.cmp-calling { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cmp-calling li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--tone-live-bg); color: var(--tone-live); font-size: .82rem; font-weight: 650; }
.cmp-calling .small { color: inherit !important; opacity: .8; }

.cmp-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cmp-prospects { display: grid; gap: 12px; min-width: 0; }
.cmp-prospects__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cmp-prospects__head h2 { margin: 0; font-size: 1.3rem; }
.cmp-prospects .mz-table-wrap { max-height: 70vh; }
.cmp-ptable td { white-space: nowrap; }
.cmp-selection__why { flex-basis: 100%; margin: 0; text-align: right; }
.cmp-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.cmp-side .card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.cmp-side__links { display: grid; gap: 8px; margin-top: 8px; }
.cmp-side__links .btn { justify-content: flex-start; margin: 0 !important; }
.cmp-side .mz-timeline { max-height: 440px; overflow: auto; }

/* Approvals */
.cmp-approvals { display: grid; gap: 10px; }
.cmp-apr { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--glass-bg); box-shadow: var(--glass-shadow); color: var(--ink) !important; text-decoration: none; }
.cmp-apr:hover { box-shadow: var(--glass-shadow), inset 0 0 0 1.5px var(--brand-200); }
.cmp-apr__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--hover-bg); color: var(--link); }
.cmp-apr__icon .lucide { width: 20px; height: 20px; }
.cmp-apr__main { display: grid; gap: 3px; min-width: 0; }
.cmp-apr__main strong { overflow-wrap: anywhere; }
.cmp-apr__facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.cmp-apr__facts b { color: var(--ink); font-weight: 650; }
.cmp-apr__side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.cmp-decide .row { margin-top: 4px; }
.cmp-decide .field { margin-bottom: 8px; }

@media (max-width: 1180px) {
  .cmp-detail { grid-template-columns: 1fr; }
  .cmp-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
  .cmp-head__actions { justify-items: start; }
  .cmp-head__actions .row { justify-content: flex-start; }
  .cmp-grid { grid-template-columns: 1fr; }
  .cmp-filters .mz-toolbar .field { flex: 1 1 140px; min-width: 0; }
  .cmp-apr { grid-template-columns: 36px minmax(0, 1fr); }
  .cmp-apr__side { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .cmp-selection__why { text-align: left; }
  .main-content .cmp-info__kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cmp-info__kv dd { margin-bottom: 0; }
  .mz-selection .row { margin-left: 0; }
}
