/* SRIDIRA CMS · WhatsApp direct messages (v9.27) - uses the CMS theme tokens, so light and dark follow the app */
.wd-st { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: var(--text-2xs, 11px); font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--neutral-bg, rgba(127,127,127,.14)); color: var(--neutral-text, var(--text-secondary)); }
.wd-st.wd-ok { background: var(--success-bg, rgba(22,163,74,.14)); color: var(--success-text, #15803d); }
.wd-st.wd-s { background: var(--primary-tint, rgba(37,99,235,.12)); color: var(--primary, #2563eb); }
.wd-st.wd-warn { background: var(--warning-bg, rgba(217,119,6,.15)); color: var(--warning-text, #b45309); }
.wd-st.wd-bad { background: var(--danger-bg, rgba(220,38,38,.13)); color: var(--danger-text, #b91c1c); }
.wc-foot .wd-st { margin-left: auto; margin-right: 6px; }
.wd-direct.wd-failed { opacity: .8; border-style: dashed; }
.wd-fail { margin-top: 6px; font-size: var(--text-xs, 12px); color: var(--danger-text, #b91c1c); }
.wd-doc { font-size: var(--text-sm, 13px); font-weight: 600; margin-bottom: 4px; }
.wd-compose .wd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; font-size: var(--text-xs, 12px); color: var(--text-secondary); }
.wd-compose .wd-meta label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.wd-compose .wd-meta select { max-width: min(320px, 70vw); font-size: var(--text-xs, 12px); padding: 4px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); }
.wd-link { background: none; border: 0; padding: 2px 0; color: var(--primary); font: inherit; font-size: var(--text-xs, 12px); text-decoration: underline; cursor: pointer; }
.wd-link:focus-visible { outline: 2px solid var(--border-focus, var(--primary)); outline-offset: 2px; border-radius: 4px; }
.wd-back { display: block; margin: 0 0 6px auto; }
.wd-warn { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; font-size: var(--text-xs, 12px); background: var(--warning-bg, rgba(217,119,6,.15)); color: var(--warning-text, #b45309); }
.wc-send.is-busy { opacity: .6; pointer-events: none; }
/* Request Center panels */
.wd-panel h4 { margin: 0 0 8px; font-size: var(--text-md, 15px); }
.wd-panel + .wd-panel, .wd-card + .wd-card { margin-top: 12px; }
.wd-intro { margin: 4px 0 12px; font-size: var(--text-sm, 13px); color: var(--text-secondary); }
.wd-empty { margin: 6px 0; color: var(--text-secondary); }
.wd-card-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.wd-card-h .muted { font-size: var(--text-xs, 12px); }
.wd-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 8px; border-radius: 10px; background: var(--surface-secondary, rgba(127,127,127,.06)); }
.wd-m { max-width: 85%; padding: 6px 10px; border-radius: 12px; font-size: var(--text-sm, 13px); background: var(--surface); border: 1px solid var(--border-subtle, var(--border)); overflow-wrap: anywhere; }
.wd-m.out { align-self: flex-end; background: var(--primary-tint, rgba(37,99,235,.1)); }
.wd-m small { display: block; margin-top: 2px; font-size: var(--text-2xs, 11px); color: var(--text-tertiary, var(--text-secondary)); }
.wd-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.wd-acts label { display: inline-flex; gap: 6px; align-items: center; font-size: var(--text-xs, 12px); min-width: 0; }
.wd-acts select, .wd-acts input { max-width: min(340px, 100%); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); }
.wd-acts .wd-err { flex-basis: 100%; margin: 0; }
.wd-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.wd-kpi { padding: 8px 10px; border-radius: 10px; background: var(--surface-secondary, rgba(127,127,127,.06)); }
.wd-kpi b { display: block; font-size: var(--text-lg, 18px); font-variant-numeric: tabular-nums; }
.wd-kpi small { color: var(--text-secondary); font-size: var(--text-2xs, 11px); }
.wd-rev { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border-subtle, var(--border)); font-size: var(--text-sm, 13px); }
.wd-rev-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-rev button.is-confirm { border-color: var(--danger-text, #b91c1c); color: var(--danger-text, #b91c1c); }
@media (max-width: 760px) {
  .wd-compose .wd-meta select { max-width: 62vw; }
  .wd-acts label, .wd-acts select, .wd-acts input { width: 100%; max-width: 100%; }
}

/* v9.27d: Start WhatsApp Chat, exclusion list */
.wa-bar .wd-start { margin-right: 6px; }
.wa-bar .wd-start[disabled] { opacity: .55; cursor: not-allowed; }
.wd-acts .wd-exc-btn.is-confirm, .wd-excl button.is-confirm { color: #a3302a; }
.wd-excl { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.wd-excl li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .wa-bar .wd-start { width: 100%; justify-content: center; margin: 0 0 6px; } }
/* v9.27e: pilot rollout panel */
.wd-panel .data-table tbody th { text-align: left; font-weight: 600; width: 40%; vertical-align: top; }
/* v9.27f: record WhatsApp permission */
.wd-perm { display: grid; gap: 8px; margin: 8px 0; padding: 12px; border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 10px; }
.wd-perm label { display: grid; gap: 4px; font-size: var(--text-sm, 13px); }
.wd-perm select, .wd-perm input { width: 100%; min-width: 0; }
/* v9.27g: Generate & Attach Cost Sheet */
.wd-modal-ov { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.wd-modal { background: var(--surface, #fff); color: var(--text, #0f172a); width: min(980px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.wd-mhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border, rgba(127,127,127,.2)); }
.wd-mhead b { display: block; font-size: var(--text-md, 15px); }
.wd-mhead small { color: var(--text-secondary, #64748b); font-size: var(--text-xs, 12px); }
.wd-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; padding: 2px 6px; }
.wd-mbody { padding: 14px 16px; overflow: auto; display: grid; gap: 10px; }
.wd-csrow { display: flex; flex-wrap: wrap; gap: 10px; }
.wd-csrow label { display: grid; gap: 4px; font-size: var(--text-sm, 13px); min-width: 160px; flex: 1; }
.wd-cs-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 1.4fr; gap: 14px; align-items: start; }
.wd-cs-t { width: 100%; border-collapse: collapse; font-size: var(--text-sm, 13px); }
.wd-cs-t td { padding: 5px 6px; border-bottom: 1px solid var(--border, rgba(127,127,127,.18)); }
.wd-cs-t td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wd-cs-t tr.wd-cs-hl td { font-weight: 700; }
.wd-cs-to { font-size: var(--text-sm, 13px); margin: 8px 0 0; }
.wd-cs-pdf { display: grid; gap: 6px; }
.wd-cs-pdf object { width: 100%; height: 62vh; min-height: 360px; border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 8px; background: #f1f5f9; }
@media (max-width: 760px) {
  .wd-modal-ov { padding: 0; align-items: stretch; }
  .wd-modal { width: 100%; max-height: 100vh; border-radius: 0; }
  .wd-cs-grid { grid-template-columns: 1fr; }
  .wd-cs-pdf object { display: none; }   /* phones open the PDF in their own viewer instead */
}
.wd-cs-open { justify-self: start; text-decoration: none; }
.wd-csrow select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, rgba(127,127,127,.35)); background: var(--surface, #fff); color: inherit; min-height: 38px; }
