/* messages.css 0.12.0 — job Messages tab + flat panel tabs */
.pm-card .h-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.pm-ban{display:flex;gap:10px;align-items:flex-start;background:#f2f7fd;border:1px solid #d6e6f8;color:#24405f;border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.45;margin:4px 0 12px}
.pm-ban svg{flex:none;width:18px;height:18px;fill:none;stroke:#1E88E5;stroke-width:2;stroke-linecap:round;margin-top:1px}
.pm-filt{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 10px}
.pm-filt button{border:1px solid var(--line,#e3e8ee);background:#fff;border-radius:999px;padding:6px 12px;font:inherit;font-size:13px;font-weight:600;color:#475467;cursor:pointer}
.pm-filt button b{display:inline-block;min-width:18px;margin-left:4px;padding:0 6px;border-radius:99px;background:#eef1f5;font-size:11.5px;color:#475467}
.pm-filt button.on{background:var(--bluebg,#E3F0FC);border-color:#b7d6f5;color:#1764c0}
.pm-filt button.on b{background:#fff;color:#1764c0}
.pm-thread{display:flex;flex-direction:column;gap:10px;max-height:min(56vh,520px);overflow-y:auto;padding:10px 4px 12px;background:#fafbfc;border:1px solid #eef1f5;border-radius:12px;min-height:120px;box-sizing:border-box}
.pm-day{text-align:center;margin:4px 0}
.pm-day span{display:inline-block;font-size:11.5px;font-weight:650;color:#667085;background:#eef1f5;border-radius:99px;padding:3px 10px}
.pm-msg{max-width:min(78%,560px);display:flex;flex-direction:column;gap:3px;margin:0 8px}
.pm-msg.out{align-self:flex-end;align-items:flex-end}
.pm-meta{display:flex;flex-wrap:wrap;gap:5px;align-items:center;font-size:11.5px;color:#667085;justify-content:flex-end}
.pm-dot{opacity:.6}
.pm-chip{font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:99px;background:#eef1f5;color:#475467;text-transform:uppercase;letter-spacing:.02em}
.pm-chip.fl{background:#fff4e5;color:#9a5b00;text-transform:none;letter-spacing:0}
.pm-b{background:#1E88E5;color:#fff;border-radius:16px 16px 4px 16px;padding:9px 12px;font-size:14px;line-height:1.4;overflow-wrap:anywhere;white-space:normal;box-shadow:0 1px 2px rgba(16,24,40,.08)}
.pm-msg.bad .pm-b{background:#fff;color:#1d2733;border:1px solid #f3b4ae}
.pm-foot{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;font-size:11.5px}
.pm-st{font-weight:650;color:#667085}.pm-st.ok{color:#1a7f4b}.pm-st.bad{color:#c4320a}
.pm-err{color:#b42318;max-width:100%;overflow-wrap:anywhere}
.pm-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#667085;font-size:13.5px;margin:auto;padding:18px 8px;text-align:center}
.pm-empty svg{width:28px;height:28px;fill:none;stroke:#98a2b3;stroke-width:1.8;stroke-linejoin:round}
.pm-empty p{margin:0}
.pm-comp{margin-top:12px;display:flex;flex-direction:column;gap:8px}
.pm-crow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.pm-cf{position:relative;display:flex;flex-direction:column;gap:2px;border:1px solid var(--line,#e3e8ee);border-radius:10px;background:#fff;padding:5px 10px 4px;min-width:0;cursor:pointer}
.pm-cf>span{font-size:11px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--ink3,#8a94a0)}
.pm-cf select{appearance:none;-webkit-appearance:none;border:0;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235f6b78' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center;font:inherit;font-size:13.5px;font-weight:600;color:var(--ink,#1d2733);height:24px;padding:0 18px 0 0;width:100%;min-width:0;text-overflow:ellipsis;cursor:pointer}
.pm-cbox{border:1px solid var(--line,#e3e8ee);border-radius:12px;background:#fff;padding:8px 10px;display:flex;flex-direction:column;gap:6px}
.pm-cbox:focus-within{border-color:var(--blue,#1E88E5);box-shadow:0 0 0 3px rgba(30,136,229,.15)}
.pm-cbox textarea{border:0;resize:vertical;font:inherit;font-size:14px;min-height:60px;width:100%;box-sizing:border-box;outline:none;padding:2px}
.pm-cact{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pm-cact .grow{flex:1}
.pm-len{font-size:11.5px;color:#667085;font-variant-numeric:tabular-nums}
.pm-cact .btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round;margin-right:5px;vertical-align:-2px}
.pm-cact .btn[hidden]{display:none}
.pm-note{font-size:12px;color:#667085;min-height:1em}
/* tab count turns red when a text failed */
.jt-n.bad{background:#fde3e1!important;color:#b42318!important}
/* flat panel: Details | Messages */
.fd-tabs{display:flex;gap:4px;padding:6px;margin:10px 22px 0;background:#eef2f7;border:1px solid #e1e7ef;border-radius:12px;flex:none;overflow-x:auto} /* f10: 5 tabs now (was 2); gap tightened, horizontal scroll is the fallback on a very narrow drawer, never the page itself */
.fd-tab{flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:5px;border:0;background:transparent;border-radius:9px;padding:8px 6px;font:inherit;font-size:12.5px;font-weight:650;color:#5b6676;cursor:pointer;white-space:nowrap}
.fd-tab.on{background:#fff;color:#14284b;box-shadow:0 1px 3px rgba(16,24,40,.12)}
.fd-tn{min-width:18px;height:18px;padding:0 6px;border-radius:99px;background:#dfe6ef;color:#344054;font-size:11px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
.fd-tn.bad{background:#fde3e1;color:#b42318}
.fd-tn[hidden],.fd-b[hidden]{display:none!important}
.pm-fpane{padding-top:12px}
.pm-fpane .pm-thread{max-height:none;min-height:160px}
/* flats list: red dot = a text to this flat failed */
.pm-fb{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:6px;vertical-align:1px;background:#1E88E5}
.pm-fb.bad{background:#d92d20}
.pm-fb[hidden]{display:none}
@media (max-width:700px){
  .jt-tabs{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;padding:4px!important}
  .jt-tab{flex-direction:column;gap:2px!important;padding:7px 1px 6px!important;font-size:11px!important;position:relative}
  .jt-tab .jt-ic svg{width:18px;height:18px}
  .jt-tab .jt-l{max-width:100%;font-size:10.5px;line-height:1.2;letter-spacing:-.15px}
  .jt-tab .jt-n{position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;font-size:10px}
  /* 0.14.3 (David 30 Oct 14:51): "Financial Docs" shows in full on phones (two short lines), icons stay level */
  .jt-tab{justify-content:flex-start!important}
  .jt-tab[data-jrt="quote"] .jt-l{white-space:normal;text-align:center;line-height:1.15}
  .pm-crow{grid-template-columns:1fr}
  .pm-msg{max-width:88%}
  .fd-tabs{margin:10px 14px 0}
  /* f10 (David 9 Nov, tabs redesign): phone drawer must look exactly as it did before -- Contact log/Visits/Report keep showing stacked under Details on a phone (desktop gets the 3 new tabs, not the phone); only Details/Messages exist as tabs here, same as today */
  .fd-tab[data-fdt="log"],.fd-tab[data-fdt="visits"],.fd-tab[data-fdt="report"]{display:none}
  .fd-b[data-fdp="log"],.fd-b[data-fdp="visits"],.fd-b[data-fdp="report"]{display:block!important}
}

/* f11 (David 9 Nov 22:36 "Yes please"): Communication tab -- Texts | Emails switch, inline (click-based), nothing floating */
.pm-csw{display:flex;gap:4px;padding:4px;margin:10px 22px 0;background:#eef2f7;border:1px solid #e1e7ef;border-radius:10px;flex:none}
.pm-cst{flex:1 1 0;border:0;background:transparent;border-radius:7px;padding:6px 10px;font:inherit;font-size:12px;font-weight:650;color:#5b6676;cursor:pointer}
.pm-cst.on{background:#fff;color:#14284b;box-shadow:0 1px 3px rgba(16,24,40,.12)}
.pm-cspane{padding:0 22px 16px}
.pm-cspane[hidden]{display:none!important}
.pm-cspane .pm-thread{padding-top:0}
.pm-elist{padding-top:12px}
.pm-elog{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.pm-erow{border:1px solid #e7ebf1;border-radius:10px;background:#fff;overflow:hidden}
/* f18 (David 10 Nov 12:16 "expand the full email"): the header that used to be the <li>'s own content is now one <button> (whole row = tap target, not hover-only), styled the same as before; the open/close pattern below copies comms.css's .cm-item/.cm-body look into this file's own pm- classes */
.pm-erh{display:block;width:100%;text-align:left;border:0;background:none;font:inherit;color:inherit;margin:0;padding:10px 34px 10px 12px;cursor:pointer;position:relative}
.pm-erh:hover{background:#f7f9fc}
.pm-erh:focus-visible{outline:2px solid #1E88E5;outline-offset:-2px}
.pm-erow.open .pm-erh{background:#f7f9fc}
.pm-erowh{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12.5px;color:#344054}
.pm-estatus{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding:2px 7px;border-radius:99px;background:#eef2f7;color:#5b6676}
.pm-estatus.pm-es-sent,.pm-estatus.pm-es-delivered{background:#e3f6ec;color:#127046}
.pm-estatus.pm-es-failed,.pm-estatus.pm-es-blocked{background:#fde3e1;color:#b42318}
.pm-erto{font-size:12.5px;color:#5b6676;margin-top:4px}
.pm-esubj{font-size:13px;font-weight:650;margin-top:2px}
.pm-eprev{font-size:12.5px;color:#7a8698;margin-top:2px}
.pm-echev{position:absolute;top:50%;right:10px;transform:translateY(-50%);display:flex;color:#98a2b3;transition:transform .15s}
.pm-echev svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.pm-erow.open .pm-echev{transform:translateY(-50%) rotate(90deg)}
.pm-ebody{padding:2px 12px 12px;background:#f7f9fc;border-top:1px solid #eef1f5}
.pm-emeta{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:6px 16px;margin:10px 0;padding:0}
.pm-emeta dt{font-size:10px;font-weight:750;letter-spacing:.05em;text-transform:uppercase;color:#7a8597;margin:0}
.pm-emeta dd{margin:1px 0 0;font-size:12.5px;color:#26303b;overflow-wrap:anywhere}
.pm-etxt{padding:10px 12px;border:1px solid #e6ebf1;border-radius:10px;background:#fff;font-size:13px;line-height:1.5;color:#26303b;overflow-wrap:anywhere}
.pm-ecomp{padding:14px 0 4px}
@media (max-width:700px){
  .pm-csw{margin:10px 14px 0}
  .pm-cspane{padding:0 14px 16px}
}
