/* comms.css v1.1.0 (2026-12-01 GMT: the broker editor, the Notes column); v1.0.0 (2026-12-01 GMT): Sales Admin > Comms (/admin/comms). Colours are the site's (style.css aliases of shared.css's --pi-* tokens). */
[data-page="comms"] [hidden] { display: none !important; }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cm-head-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cm-as select { margin-left: .4rem; }
.cm-chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); background: var(--card); }
.cm-chip.ok { border-color: #8cc9a0; background: #edf8f1; color: #1f6b3a; }
.cm-chip.bad { border-color: #e5a3a3; background: #fdf0f0; color: #8a1f1f; }
.cm-chip.warn { border-color: var(--warn-line); background: var(--warn-bg); color: #6b5200; }

.cm-tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin: .5rem 0 1rem; overflow-x: auto; }
.cm-tabs button { border: 0; background: none; padding: .55rem .9rem; font: inherit; font-size: .95rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.cm-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); font-weight: 700; }
.cm-badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: #c0392b; color: #fff; font-size: .72rem; line-height: 1.5; text-align: center; font-weight: 700; }
.cm-error { padding: .6rem .9rem; margin-bottom: 1rem; border: 1px solid #e5a3a3; background: #fdf0f0; color: #8a1f1f; border-radius: 6px; }

.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.cm-bar input[type="search"] { min-width: 16rem; flex: 1 1 16rem; max-width: 28rem; }
.cm-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.cm-card h2 { font-size: 1.05rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .6rem; }
.cm-mt { margin-top: 1.4rem !important; }
.cm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cm-tpl { grid-template-columns: minmax(14rem, 1fr) 2fr; }
@media (max-width: 900px) { .cm-grid2, .cm-tpl { grid-template-columns: 1fr; } }

.cm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.cm-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; }
.cm-kpi b { display: block; font-size: 1.6rem; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-kpi span { font-size: .8rem; color: var(--muted); }
.cm-kpi small { display: block; font-size: .75rem; color: var(--muted); }

.cm-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.cm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cm-table th, .cm-table td { padding: .45rem .6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.cm-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--paper); }
.cm-table td.num, .cm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cm-table tr:last-child td { border-bottom: 0; }
.cm-table small { display: block; color: var(--muted); font-size: .78rem; }
.cm-table .cm-ck { width: 2rem; }
.cm-click tbody tr { cursor: pointer; }
.cm-click tbody tr:hover td, .cm-table tr.sel td { background: #eef6fb; }
.cm-table tr.off td { color: var(--muted); }
.cm-steps select { max-width: 18rem; }
.cm-steps input[type="number"] { width: 4.5rem; }

.cm-st { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.cm-st.active { background: #e8f1fb; color: #1d4f86; }
.cm-st.paused { background: #f1f1f1; color: #555; }
.cm-st.replied { background: #fff3d6; color: #7a5200; border-color: #f0c96a; }
.cm-st.success { background: #e4f5ea; color: #1f6b3a; }
.cm-st.recontact { background: #efe9fb; color: #5a3d99; }
.cm-st.ignore, .cm-st.finished { background: #f1f1f1; color: #666; }
.cm-st.bounced, .cm-st.invalid, .cm-st.failed { background: #fdeaea; color: #8a1f1f; }
.cm-st.unsubscribed { background: #fdeaea; color: #8a1f1f; }
.cm-st.other { background: #f6f6f6; color: #777; }

.cm-pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin: .8rem 0; }
.cm-enrol { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .7rem 1rem; margin-top: .5rem;
	background: var(--card); border: 1px solid var(--blue); border-radius: 8px; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.cm-inline { display: inline-flex !important; align-items: center; gap: .35rem; text-transform: none; letter-spacing: 0; font-weight: 400; }

.cm-filters { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.cm-filters button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .2rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink); }
.cm-filters button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.cm-filters button i { font-style: normal; opacity: .75; margin-left: .25rem; }

.cm-feed { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.cm-feed li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .7rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .9rem; }
.cm-feed li:last-child { border-bottom: 0; }
.cm-feed li:hover { background: #eef6fb; }
.cm-feed .when { color: var(--muted); font-size: .8rem; text-align: right; white-space: nowrap; }
.cm-feed .what small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46rem; }

.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-list li { padding: .4rem .5rem; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: .5rem; }
.cm-list li:hover, .cm-list li.sel { background: #eef6fb; }
.cm-list li small { color: var(--muted); }
#tp-form label, #sq-form label, .cm-form label { display: block; margin-bottom: .6rem; font-size: .85rem; }
#tp-form input[type="text"], #tp-form textarea, #sq-form input[type="text"], .cm-form input:not([type="checkbox"]), .cm-form select, .cm-form textarea { display: block; width: 100%; margin-top: .2rem; }
#tp-form textarea { font-family: inherit; line-height: 1.5; }
.cm-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.cm-danger { color: #8a1f1f !important; }
.cm-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem .3rem; margin: 0 0 .9rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1rem; }
.cm-form legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.cm-form .cm-wide { grid-column: 1 / -1; }
.cm-days { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; font-size: .85rem; }
.cm-days label { display: inline-flex !important; align-items: center; gap: .2rem; margin: 0 !important; }

/* the contact drawer and the modal */
.cm-drawer { position: fixed; inset: 0; z-index: 1000; }
.cm-drawer-back { position: absolute; inset: 0; background: rgba(15, 37, 54, .35); }
.cm-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(46rem, 100%); background: var(--paper); overflow-y: auto; padding: 1.2rem 1.4rem 2rem; box-shadow: -8px 0 24px rgba(0, 0, 0, .15); }
.cm-modal-panel { position: relative; margin: 6vh auto; width: min(44rem, 94%); max-height: 86vh; overflow-y: auto; background: var(--card); border-radius: 10px; padding: 1.2rem 1.4rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.cm-x { position: absolute; top: .5rem; right: .7rem; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); }
.dr-head h2 { margin: 0 2rem .2rem 0; font-size: 1.3rem; }
.dr-head p { margin: 0 0 .3rem; color: var(--muted); font-size: .9rem; }
.dr-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0; }
.dr-form { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; margin-bottom: .9rem; }
.dr-form label { display: block; margin-bottom: .5rem; font-size: .85rem; }
.dr-form textarea, .dr-form input[type="date"], .dr-form select { display: block; width: 100%; margin-top: .2rem; }
.dr-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.dr-timeline li { position: relative; padding: .35rem 0 .6rem 1rem; font-size: .88rem; }
.dr-timeline li::before { content: ""; position: absolute; left: -6px; top: .7rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dr-timeline li.reply::before { background: #e0a500; }
.dr-timeline li.out::before { background: var(--blue); }
.dr-timeline li.bad::before { background: #c0392b; }
.dr-timeline li.good::before { background: #2e8b57; }
.dr-timeline li.machine { opacity: .55; }
.dr-timeline .t { color: var(--muted); font-size: .78rem; }
.dr-timeline .msg { margin-top: .3rem; padding: .5rem .7rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; white-space: pre-wrap; max-height: 16rem; overflow: auto; font-size: .85rem; }
.md-preview { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; background: #fff; font-family: Consolas, monospace, Verdana, Helvetica, Arial, sans-serif !important; font-size: 14px; line-height: 1.5; color: #222; }   /* as the emails (comms-lib.php commsFont) */
.md-meta { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.md-meta b { color: var(--ink); }
.cm-empty { color: var(--muted); padding: 1rem; text-align: center; }
.cm-muted { color: var(--muted); }

/* the broker editor and notes (v1.1.0) */
.br-notes { max-width: 16rem; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; margin-top: .8rem; }
.be-grid label { display: block; font-size: .85rem; }
.be-grid input, .be-grid textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .2rem; font: inherit; }
.be-grid textarea { resize: vertical; }
.be-wide { grid-column: 1 / -1; }
.be-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
#be-msg { color: #b3261e; }
.dr-notes { white-space: pre-wrap; background: #fffbea; border: 1px solid #f0e2a8; border-radius: 6px; padding: .5rem .7rem; font-size: .9rem; }
@media (max-width: 560px) { .be-grid { grid-template-columns: 1fr; } }
