/* ============================================================
   Solution Provider Bridge CRM — dark premium, mobile-first
   Brand: navy/charcoal base, blue #0E7EA6, gold #C9A45C,
   ivory text #FFFDF8. Green=done, Red=urgent, Amber=pending.
   ============================================================ */

:root {
  --bg: #0d1420;
  --bg-2: #101a2b;
  --card: #16213422;
  --card-solid: #152036;
  --border: rgba(201, 164, 92, 0.12);
  --border-2: rgba(255, 253, 248, 0.08);
  --text: #fffdf8;
  --muted: #9aa7ba;
  --blue: #0e7ea6;
  --blue-deep: #006289;
  --gold: #c9a45c;
  --green: #2ecc71;
  --red: #e74c3c;
  --amber: #f0a340;
  --wa: #25d366;
  --radius: 14px;
  --nav-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Bengali", sans-serif;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(14, 126, 166, 0.18), transparent 60%),
    radial-gradient(800px 400px at -10% 30%, rgba(201, 164, 92, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 14px);
}

a { color: var(--blue); text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 20, 32, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  max-width: 1200px; margin: 0 auto; padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 15px; }
/* Transparent logo (dark grey turned light for the dark top bar). Phones show only the gear icon. */
.brand-logo, .brand-icon { display: block; }
.brand-logo { height: 32px; width: auto; }
.brand-icon { display: none; width: 34px; height: 34px; }
@media (max-width: 560px) { .brand-logo { display: none; } .brand-icon { display: block; } }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; font-size: 13px; font-weight: 800;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  border: 1px solid rgba(201, 164, 92, 0.35); color: #fff;
}
.desktop-nav { display: none; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.user-chip { color: var(--gold); font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link { color: var(--muted); }

/* Settings: section menu on the left (a scrollable row of tabs on phones), one section at a time. */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 10px; }
.settings-nav { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 4px; background: var(--card, rgba(255,255,255,0.03)); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 8px; }
.settings-nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.settings-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.settings-nav a.on { background: rgba(201, 164, 92, 0.14); color: var(--gold); }
.settings-body > .section-title:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; gap: 10px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .settings-nav a { white-space: nowrap; flex: 0 0 auto; padding: 8px 12px; }
}

/* Call analysis: progress while the AI works (estimate), replaced by the result without a reload. */
.ai-progress { margin: 10px 0; }
.ai-progress-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ai-progress-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #74c4e2); transition: width .5s ease; }
.ai-progress-text { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.ai-progress.failed .ai-progress-bar { background: #e74c3c; } .ai-progress.failed .ai-progress-text { color: #ff9d90; }

/* Settings → AI engines: one row per engine, ⓘ opens the account / dashboard / free limit box. */
.ai-connect-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 14px; margin: 16px 0; }
.ai-connect-form { border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 16px; background: rgba(255,255,255,.03); }
.ai-connect-form h3 { margin: 0 0 8px; }
.ai-connect-form label { display: block; margin: 14px 0 10px; }
.ai-connect-form input, .ai-connect-form select { width: 100%; margin-top: 6px; }
.ai-connect-form details { margin: 10px 0; }
.ai-connect-form summary { cursor: pointer; color: var(--blue); }
[data-ai-field][hidden] { display: none !important; }
.ai-engine { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; margin: 10px 0; background: rgba(255,255,255,0.02); }
.ai-engine.off { opacity: 0.6; }
.ai-engine-head { display: flex; gap: 10px; align-items: flex-start; }
.ai-engine-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: rgba(201,164,92,0.18); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.ai-engine-name { flex: 1; min-width: 0; word-break: break-word; }
.ai-engine-status { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.ai-info { position: relative; }
.ai-info > summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(116,196,226,0.5); color: #74c4e2; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.ai-info > summary::-webkit-details-marker { display: none; }
.ai-info-box { position: absolute; right: 0; top: 34px; z-index: 20; width: min(420px, 86vw); background: var(--card-solid); border: 1px solid rgba(116,196,226,0.4); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); font-size: 13px; }
.ai-info-box p { margin: 0 0 8px; } .ai-info-box a { word-break: break-all; }
.ai-edit[open], .ai-add[open] { width: 100%; order: 10; } .ai-edit[open] > summary, .ai-add[open] > summary { margin-bottom: 10px; }
.ai-edit > summary, .ai-add > summary { list-style: none; } .ai-edit > summary::-webkit-details-marker, .ai-add > summary::-webkit-details-marker { display: none; }
.ai-engine .card-actions form { margin: 0; }

/* Meetings: a save that matched an existing meeting shows it instead of adding a copy. */
.dup-warning { border: 1px solid rgba(240, 163, 64, 0.55); background: rgba(240, 163, 64, 0.1); border-radius: 12px; padding: 14px 16px; margin: 10px 0 14px; }
.dup-warning-title { color: #f5c98a; font-weight: 800; margin-bottom: 6px; }
.dup-warning p { margin: 0 0 10px; }
.card.meeting-dup { border-color: rgba(240, 163, 64, 0.8); box-shadow: 0 0 0 2px rgba(240, 163, 64, 0.35); scroll-margin-top: 80px; }

/* WhatsApp number switch: "are you sure" box before changing the number. */
.confirm-dialog { margin: auto; max-width: 380px; width: calc(100% - 32px);border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 14px; background: #121a28; color: var(--text); padding: 20px; }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.confirm-dialog h2 { font-size: 17px; margin: 0 0 8px; }
.confirm-dialog p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.confirm-dialog .form-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Leads list: the next 50 load by themselves at the bottom (spinner), then "No more leads". */
.load-more { text-align: center; margin: 16px 0 8px; min-height: 40px; }
.load-more-status { color: var(--muted); font-size: 13px; margin: 8px 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.load-more-status:empty { margin: 0; }
.load-more-status.failed { color: #ff9d90; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--gold); animation: sp-spin 0.8s linear infinite; }
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ---------- Page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 14px; }
.page-title { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--gold); letter-spacing: 0.4px; margin: 20px 0 10px; text-transform: uppercase; }
.followup-history { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 2px; }
.followup-history-list { display: grid; gap: 8px; }
.followup-history-entry { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(13, 20, 32, 0.48); }
.followup-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.followup-history-head time, .followup-history-meta { color: var(--muted); font-size: 12px; }
.followup-history-meta { margin-top: 5px; }
.followup-history-note { margin: 8px 0 0; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.followup-history-note.muted { color: var(--muted); }

/* ---------- Lead details (mobile first) ---------- */
.lead-detail-header { display: grid; gap: 12px; margin-bottom: 14px; }
.lead-back { display: inline-flex; align-items: center; min-height: 44px; margin: -4px 0 2px; color: #74c4e2; font-size: 13px; font-weight: 700; }
.lead-detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lead-detail-contact { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.lead-detail-contact .btn { width: 100%; }
.lead-detail-card { padding: 14px; }
.lead-detail-card .card-head { margin-bottom: 12px; }
.lead-detail-actions { display: grid; grid-template-columns: 1fr 1fr; }
.lead-detail-actions .btn { width: 100%; }
.lead-meta-card .card-title { margin-bottom: 10px; }
.lead-meta-facts { margin-top: 0; }
.lead-detail-history { margin-top: 10px; padding-top: 14px; }
.lead-detail-history .section-title { margin-top: 0; }
.lead-detail-bottom-back { width: 100%; margin-top: 4px; }
.cards-2col > .card { scroll-margin-top: 74px; }

/* ---------- Flash ---------- */
.flash { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; border: 1px solid; }
.flash.good, .flash.ok { background: rgba(46, 204, 113, 0.12); border-color: rgba(46, 204, 113, 0.4); color: #7ee2ab; }
.flash.err  { background: rgba(231, 76, 60, 0.12);  border-color: rgba(231, 76, 60, 0.45); color: #f1a099; }
.flash.warn { background: rgba(240, 163, 64, 0.12); border-color: rgba(240, 163, 64, 0.45); color: #f5c98a; }
.flash.warn a { color: var(--gold); font-weight: 700; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi {
  background: linear-gradient(160deg, rgba(22, 33, 52, 0.9), rgba(16, 26, 43, 0.9));
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 13px 14px; display: block; color: var(--text);
}
.kpi .k-num { font-size: 24px; font-weight: 800; line-height: 1.15; }
.kpi .k-label { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: 0.2px; }
.kpi.k-red   { border-color: rgba(231, 76, 60, 0.5); }  .kpi.k-red .k-num { color: #ff8a7a; }
.kpi.k-amber { border-color: rgba(240, 163, 64, 0.45); } .kpi.k-amber .k-num { color: var(--amber); }
.kpi.k-green { border-color: rgba(46, 204, 113, 0.4); }  .kpi.k-green .k-num { color: var(--green); }
.kpi.k-gold  { border-color: rgba(201, 164, 92, 0.55); } .kpi.k-gold .k-num { color: var(--gold); }
.kpi.k-blue .k-num { color: #5fb9d8; }

/* ---------- Cards / list rows ---------- */
.card {
  background: linear-gradient(165deg, rgba(22, 33, 52, 0.92), rgba(15, 24, 40, 0.92));
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
}
.card.urgent { border-color: rgba(231, 76, 60, 0.55); }
.card-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; }
.card-title small { color: var(--muted); font-weight: 400; }
.card-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.card-meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.55; }
.card-meta b { color: var(--text); font-weight: 600; }
.card-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px; border: 1px solid;
  white-space: nowrap;
}
.b-green { color: #7ee2ab; background: rgba(46, 204, 113, 0.13); border-color: rgba(46, 204, 113, 0.4); }
.b-red   { color: #ff9d90; background: rgba(231, 76, 60, 0.14);  border-color: rgba(231, 76, 60, 0.45); }
.b-amber { color: #f5c98a; background: rgba(240, 163, 64, 0.13); border-color: rgba(240, 163, 64, 0.4); }
.b-blue  { color: #74c4e2; background: rgba(14, 126, 166, 0.16); border-color: rgba(14, 126, 166, 0.5); }
.b-gray  { color: var(--muted); background: rgba(154, 167, 186, 0.1); border-color: rgba(154, 167, 186, 0.3); }
.b-gold  { color: var(--gold); background: rgba(201, 164, 92, 0.12); border-color: rgba(201, 164, 92, 0.45); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 9px 16px; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent;
  color: #fff; background: linear-gradient(135deg, var(--blue-deep), var(--blue));
}
.btn:active { transform: scale(0.98); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn.gold  { background: linear-gradient(135deg, #a8843f, var(--gold)); color: #1c1608; }
.btn.green { background: linear-gradient(135deg, #1e9e54, var(--green)); }
.btn.red   { background: linear-gradient(135deg, #b93325, var(--red)); }
.btn.wa    { background: var(--wa); color: #06300f; }
.btn.call  { background: rgba(14, 126, 166, 0.2); border-color: rgba(14, 126, 166, 0.55); color: #74c4e2; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-panel { display: none; }
.form-panel.open { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: rgba(13, 20, 32, 0.7); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px; font-size: 14px;
  font-family: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}
.field.field-error input { border-color: var(--red); }
.field.field-error input:focus { outline-color: var(--red); }
.field-error-text { display: block; color: #ff8a7a; font-size: 12px; margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar input[type="text"], .filter-bar input[type="search"] {
  flex: 1 1 160px; min-height: 44px; padding: 9px 13px; font-size: 14px;
  background: rgba(13, 20, 32, 0.7); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px;
}
.filter-bar select {
  min-height: 44px; padding: 8px 10px; font-size: 13px;
  background: rgba(13, 20, 32, 0.7); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px; max-width: 46%;
}
.filter-date { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.filter-date input {
  min-height: 44px; padding: 8px 10px; color-scheme: dark;
  background: rgba(13, 20, 32, 0.7); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px;
}

/* ---------- Integration health ---------- */
.integration-summary { border-left: 4px solid var(--muted); }
.integration-summary.health-connected { border-left-color: var(--green); }
.integration-summary.health-warning { border-left-color: var(--amber); }
.integration-summary.health-disconnected { border-left-color: var(--red); }
.health-grid { display: grid; gap: 10px; margin-top: 14px; }
.health-panel { padding: 13px; border: 1px solid var(--border-2); border-radius: 12px; background: rgba(13,20,32,.45); }
.health-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.health-panel-head h2 { font-size: 14px; }
.health-facts { display: grid; gap: 8px; }
.health-facts div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-2); padding-top: 8px; }
.health-facts dt { color: var(--muted); font-size: 12px; }
.health-facts dd { text-align: right; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.health-note { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.5; }
.wa-thread { display: grid; gap: 8px; margin: 14px 0; max-height: 440px; overflow: auto; padding: 10px; border: 1px solid var(--border-2); border-radius: 12px; background: rgba(5,12,22,.45); }
.wa-message { width: min(88%, 560px); padding: 10px 12px; border-radius: 12px 12px 12px 3px; background: rgba(22,33,52,.95); border: 1px solid var(--border-2); }
.wa-message.outbound { justify-self: end; border-radius: 12px 12px 3px 12px; background: rgba(12,91,65,.36); }
.wa-message p { margin: 5px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.wa-message-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Lead center: sources + clickable cards ---------- */
.lead-card[data-card-href] { cursor: pointer; transition: border-color .15s; }
.lead-card[data-card-href]:hover { border-color: rgba(14, 126, 166, 0.45); }
.lead-card-link { color: inherit; }
.lead-chat-preview { display: flex; gap: 6px; align-items: baseline; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(37, 211, 102, 0.06); color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.lead-chat-preview time { margin-left: auto; white-space: nowrap; font-size: 11px; }
.lead-chat-preview.unread { color: var(--text); font-weight: 700; background: rgba(37, 211, 102, 0.12); }
.lead-chat-preview.unread time { color: var(--wa); }

/* ---------- WhatsApp chat page ---------- */
.wa-chat { display: flex; flex-direction: column; height: calc(100dvh - 150px - var(--nav-h)); min-height: 420px; border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; background: rgba(5, 12, 22, .55); }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card-solid); border-bottom: 1px solid var(--border-2); }
.wa-chat-back { font-size: 20px; color: var(--muted); padding: 4px 6px; }
.wa-chat-profile { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--text); border-radius: 10px; padding: 2px 4px; }
.wa-chat-profile:hover { background: rgba(255, 253, 248, 0.05); }
.wa-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-deep), var(--blue)); font-weight: 800; }
.wa-chat-who { display: grid; min-width: 0; }
.wa-chat-who strong, .wa-chat-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-who small { color: var(--muted); font-size: 11.5px; }
.wa-chat-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wa-chat-meeting { display: block; padding: 7px 14px; background: rgba(201, 164, 92, 0.12); border-bottom: 1px solid var(--border-2); color: var(--gold); font-size: 12.5px; font-weight: 700; }
.field .check-line { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 13px; }
.field .check-line input { width: auto; min-height: 0; }
.lead-card-meeting { margin-top: 6px; color: var(--gold); font-size: 12.5px; font-weight: 700; }
.wa-chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.wa-day { align-self: center; margin: 8px 0; }
.wa-day span { padding: 4px 10px; border-radius: 8px; background: var(--card-solid); color: var(--muted); font-size: 11px; }
.wa-bubble { max-width: min(80%, 560px); padding: 7px 10px 5px; border-radius: 10px 10px 10px 3px; background: #1d2b42; align-self: flex-start; }
.wa-bubble.out { align-self: flex-end; border-radius: 10px 10px 3px 10px; background: #0f5c44; }
.wa-bubble p { line-height: 1.45; overflow-wrap: anywhere; font-size: 14px; }
.wa-bubble-meta { display: block; text-align: right; color: rgba(255, 253, 248, 0.6); font-size: 10.5px; margin-top: 2px; }
.wa-media { display: block; max-width: 100%; width: 280px; max-height: 360px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; background: #0b1422; }
.wa-audio { display: block; width: 260px; max-width: 100%; margin-bottom: 4px; }
.wa-file { display: inline-block; padding: 8px 10px; border-radius: 8px; background: rgba(255, 253, 248, 0.08); color: var(--text); font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.wa-media-form { align-items: center; flex-wrap: wrap; }
.wa-media-form label.btn { cursor: pointer; }
.wa-media-form [data-media-caption] { min-height: 36px; }
.wa-tick { letter-spacing: -2px; }
.wa-tick.read { color: #53bdeb; }
.wa-tick.failed { color: var(--red); font-weight: 800; letter-spacing: 0; }
.wa-composer { padding: 10px 12px; background: var(--card-solid); border-top: 1px solid var(--border-2); display: grid; gap: 8px; }
.wa-composer-form { display: flex; gap: 8px; align-items: flex-end; }
.wa-composer-form.template { flex-wrap: wrap; }
.wa-composer-form.template p { flex-basis: 100%; }
.wa-composer-form textarea, .wa-composer-form select, .wa-composer-form input { flex: 1; min-width: 0; min-height: 42px; resize: none; padding: 10px 12px; border-radius: 20px; background: rgba(13, 20, 32, 0.8); color: var(--text); border: 1px solid var(--border-2); font: inherit; }
.wa-composer-form .btn { border-radius: 20px; }
@media (max-width: 520px) { .wa-btn-label, .wa-chat-badges .badge { display: none; } }
@media (min-width: 1025px) { .wa-chat { height: calc(100dvh - 120px); } }

/* ---------- Inline quick-status select ---------- */
.quick-status select {
  min-height: 38px; padding: 5px 8px; font-size: 12.5px; border-radius: 9px;
  background: rgba(13, 20, 32, 0.75); color: var(--text); border: 1px solid var(--border-2);
  max-width: 175px;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.tabs a {
  padding: 9px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap;
}
.tabs a.on { background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: #fff; border-color: transparent; }

/* ---------- Priority list ---------- */
.prio { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--border-2); margin-bottom: 8px; background: rgba(16, 26, 43, 0.8); }
.prio .p-rank { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.prio.p-red .p-rank { background: rgba(231, 76, 60, 0.2); color: #ff9d90; }
.prio.p-amber .p-rank { background: rgba(240, 163, 64, 0.18); color: var(--amber); }
.prio.p-blue .p-rank { background: rgba(14, 126, 166, 0.2); color: #74c4e2; }
.prio.p-gold .p-rank { background: rgba(201, 164, 92, 0.18); color: var(--gold); }
.prio .p-text { font-size: 13px; line-height: 1.45; }
.prio .p-text small { color: var(--muted); display: block; }

/* ---------- Report ---------- */
.report-box {
  width: 100%; background: rgba(13, 20, 32, 0.85); color: #e8eef5;
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 16px; font-family: "SF Mono", Consolas, monospace; font-size: 12px;
  white-space: pre-wrap; line-height: 1.6; max-height: 60vh; overflow: auto;
}

/* ---------- Empty state ---------- */
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 13.5px; }

/* ---------- Bottom nav ---------- */
.wa-inbox-list { display: grid; gap: 12px; margin-top: 14px; }
.wa-inbox-item { margin-bottom: 0; }
.wa-inbox-item .card-head { align-items: flex-start; gap: 10px; }
.wa-inbox-item .card-head time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wa-inbox-item p { overflow-wrap: anywhere; }
.wa-assign { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wa-assign label { flex: 1 1 220px; }
.wa-reply { display: grid; gap: 8px; margin-top: 12px; }
.wa-reply textarea, .wa-reply input { width: 100%; }
.wa-reply button { justify-self: start; }
.wa-template-list { display: grid; gap: 10px; }
.wa-assign select { display: block; width: 100%; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; height: var(--nav-h);
  background: rgba(13, 20, 32, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted);
}
.bottom-nav a .ic { font-size: 17px; line-height: 1; }
.bottom-nav a.on { color: var(--gold); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; padding: 28px 24px;
  background: linear-gradient(165deg, rgba(22, 33, 52, 0.95), rgba(15, 24, 40, 0.95));
  border: 1px solid var(--border); border-radius: 18px;
}
.login-logo { text-align: center; margin-bottom: 6px; }
.login-logo .brand-mark { width: 52px; height: 52px; font-size: 19px; border-radius: 14px; }
.login-logo img { display: inline-block; max-width: 100%; height: auto; }
.login-title { text-align: center; font-size: 18px; font-weight: 800; margin: 10px 0 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }

/* ---------- More page ---------- */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-tile {
  padding: 20px 14px; text-align: center; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(22, 33, 52, 0.9), rgba(16, 26, 43, 0.9));
  border: 1px solid var(--border-2); color: var(--text); font-weight: 700; font-size: 13.5px;
}
.more-tile .ic { display: block; font-size: 26px; margin-bottom: 8px; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
  .health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-detail-header { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .lead-detail-contact { min-width: 250px; }
  .lead-detail-actions { display: flex; }
  .lead-detail-actions .btn { width: auto; }
  .lead-meta-facts { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-detail-bottom-back { width: auto; }
}
@media (min-width: 1025px) {
  body { padding-bottom: 20px; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; gap: 4px; margin-left: 18px; }
  .desktop-nav a { padding: 8px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
  .desktop-nav a.on, .desktop-nav a:hover { color: var(--text); background: rgba(14, 126, 166, 0.16); }
  .kpi-grid { grid-template-columns: repeat(5, 1fr); }
  .form-grid { grid-template-columns: repeat(3, 1fr); }
  .cards-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards-2col .card { margin-bottom: 0; }
}
/* Follow-up scheduling dialog */
.schedule-dialog { width: min(420px, calc(100vw - 28px)); max-height: min(90vh, 700px); margin: auto; padding: 20px; overflow: auto; color: var(--text); background: var(--card-solid); border: 1px solid rgba(201, 164, 92, 0.3); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); }
.schedule-dialog::backdrop { background: rgba(3, 8, 16, 0.78); }
.schedule-dialog h2 { font-size: 18px; margin-bottom: 6px; }
.schedule-dialog-help { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.schedule-dialog .form-grid { grid-template-columns: 1fr; }
.schedule-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.schedule-quick-choice { padding: 9px 12px; min-height: 40px; color: var(--text); background: rgba(13, 20, 32, 0.7); border: 1px solid var(--border-2); border-radius: 9px; font: inherit; font-size: 13px; cursor: pointer; }
.schedule-quick-choice:hover, .schedule-quick-choice.selected { background: rgba(30, 180, 100, 0.18); border-color: #2ebd75; }
.schedule-quick-choice:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.schedule-custom-time { display: flex; align-items: stretch; gap: 8px; }
.schedule-custom-time > input { flex: 0 1 64px; width: 64px; min-width: 0; text-align: center; }
.schedule-time-colon { align-self: center; color: var(--muted); font-size: 18px; font-weight: 700; }
.schedule-period { display: flex; gap: 4px; }
.schedule-period label { position: relative; margin: 0; cursor: pointer; }
.schedule-period input { position: absolute; width: 1px; min-height: 0; height: 1px; padding: 0; opacity: 0; }
.schedule-period span { display: flex; align-items: center; justify-content: center; min-width: 46px; height: 100%; padding: 0 8px; color: var(--muted); border: 1px solid var(--border-2); border-radius: 9px; font-size: 13px; }
.schedule-period input:checked + span { color: var(--text); background: rgba(30, 180, 100, 0.18); border-color: #2ebd75; }
.schedule-period input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.schedule-summary { min-height: 18px; margin: 12px 0 0; color: var(--text); font-size: 13px; font-weight: 600; }
.schedule-time-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.schedule-dialog .form-actions { flex-wrap: wrap; }
.schedule-dialog .field-error-text[hidden] { display: none; }

.meeting-date-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.meeting-date-filter input[type=date] { max-width: 180px; }

/* ---------- Call recordings ---------- */
.call-record { display: inline-block; }
.call-record > summary { list-style: none; cursor: pointer; }
.call-record > summary::-webkit-details-marker { display: none; }
.call-record[open] { flex-basis: 100%%; }
.call-record-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.call-record-form input[type=file] { max-width: 100%%; font-size: 13px; }
.call-record-form input[type=text] { flex: 1 1 160px; min-width: 0; }
.call-record-status { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.call-record-status.failed { color: var(--red, #e74c3c); }
.call-record-status.done { color: var(--green, #2ecc71); font-weight: 600; }
.call-check { width: 20px; height: 20px; border-radius: 50%%; background: var(--green, #2ecc71); position: relative; animation: call-pop .45s ease-out; }
.call-check::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); animation: call-tick .35s .3s ease-out forwards; }
@keyframes call-pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes call-tick { to { transform: rotate(45deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .call-check, .call-check::after { animation: none; transform: rotate(45deg); } .call-check { transform: none; } }
.lead-card-calls { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.call-rec-player { width: 100%%; margin: 8px 0; }
.call-rec-analysis { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(127,127,127,.08); }
.call-rec-analysis h3 { font-size: 14px; margin: 0 0 6px; }
.call-rec-transcript { margin-top: 8px; }
.dup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid rgba(127,127,127,.15); }
.dup-row .muted { font-size: 13px; }
.table-wrap { overflow-x: auto; margin-top: 12px; border-radius: 12px; border: 1px solid rgba(127,127,127,.2); }
.data-table { width: 100%%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(127,127,127,.15); }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.data-table td .badge { white-space: nowrap; }
.wa-live-bar { position: fixed; left: 50%%; bottom: 84px; transform: translateX(-50%%); z-index: 60; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--green, #25d366); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: pointer; }
.lead-card-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(240,163,64,.12); font-size: 13px; }
.lead-card-check span { flex: 1 1 100%%; }
.lead-card-check input[type=text] { flex: 1 1 160px; min-width: 0; }
.wa-number-row { padding: 8px 0; border-bottom: 1px solid rgba(127,127,127,.15); }
.wa-number-add { margin: 10px 0; }
.wa-number-add > summary { list-style: none; cursor: pointer; display: inline-block; }
.wa-switch { display: inline-flex; }
.wa-switch select { padding: 4px 8px; font-size: 13px; border-radius: 999px; max-width: 200px; }
.connect-steps { margin: 0 0 12px 18px; padding: 0; line-height: 1.6; }
.fu-date-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; }
.fu-date-bar input[type=date] { max-width: 170px; }

/* Team activity (team-activity.php) */
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.team-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.team-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.team-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.team-card:hover { border-color: var(--gold); }
.team-card.quiet { opacity: .6; }
.team-big { margin: 8px 0 2px; font-size: 14px; }
.team-big b { color: var(--gold); font-size: 17px; }
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.team-chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(201,164,92,.12); color: var(--text); }
.team-chip b { color: var(--gold); }
.team-open { display: block; margin-top: 10px; font-size: 12.5px; color: var(--gold); }
.team-timeline { list-style: none; margin: 0; padding: 0; }
.team-timeline li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.team-timeline li:last-child { border-bottom: 0; }
.team-timeline time { color: var(--gold); font-size: 12.5px; font-weight: 600; padding-top: 2px; }
.team-list { margin: 4px 0 12px; padding-left: 18px; line-height: 1.9; font-size: 13.5px; }
.team-sub { font-size: 13.5px; margin: 10px 0 2px; }
.team-late { color: var(--red); }
.team-more summary { cursor: pointer; color: var(--gold); font-size: 13px; margin: 4px 0; }

/* Loud "AI is off" warning (call analysis, upload forms) */
.ai-off-warning { border: 2px solid rgba(240, 163, 64, 0.7); background: rgba(240, 163, 64, 0.12); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
.ai-off-warning p { margin: 6px 0; line-height: 1.55; }
.ai-off-title { color: #f5c98a; font-weight: 800; font-size: 15.5px; }
.ai-off-bn { color: #f5c98a; }
.ai-off-line { margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; background: rgba(240, 163, 64, 0.12); border: 1px solid rgba(240, 163, 64, 0.5); color: #f5c98a; font-size: 12.5px; }
.ai-off-line a { color: var(--gold); font-weight: 700; }
.call-ai-actions { display: contents; }
.call-ai-actions form { display: inline; }
.call-ai-actions[hidden], .call-ai-actions form[hidden] { display: none; }
.call-rec-older { margin-top: 8px; }
.call-rec-older summary { cursor: pointer; color: var(--gold); font-size: 13px; }
.call-rec-old { border-left: 3px solid rgba(201,164,92,.4); padding: 4px 10px; margin: 8px 0; }
.call-rec-old p { margin: 4px 0 0; }

/* Report page (daily-report.php): tabs, risk banner, section cards; red request counts in menus */
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: middle; }
.bottom-nav a { position: relative; }
.nav-count-dot { position: absolute; top: 2px; left: 50%; margin-left: 6px; }
.risk-banner { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 12px 14px; border-radius: 12px; border: 1px solid; margin: 0 0 12px; font-size: 14px; color: inherit; text-decoration: none; }
.risk-banner .risk-label { font-weight: 800; }
.risk-high { background: rgba(231, 76, 60, 0.12); border-color: rgba(231, 76, 60, 0.5); }
.risk-high .risk-label { color: #ff9d90; }
.risk-medium { background: rgba(240, 163, 64, 0.12); border-color: rgba(240, 163, 64, 0.5); }
.risk-medium .risk-label, a.risk-medium b { color: #f5c98a; }
.risk-ok { background: rgba(46, 204, 113, 0.1); border-color: rgba(46, 204, 113, 0.4); }
.risk-ok .risk-label { color: #7ee2ab; }
.report-kpis { margin-bottom: 14px; }
@media (min-width: 760px) { .report-kpis { grid-template-columns: repeat(5, 1fr); } }
.report-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 900px) { .report-grid { grid-template-columns: 1fr 1fr; } }
.report-grid .card { margin-bottom: 0; }
.report-sec .card-title { margin-bottom: 8px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.report-list li:last-child { border-bottom: 0; }
.rl-main { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rl-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.report-share { margin-top: 14px; }
.report-share details { margin-top: 10px; }
.team-line .muted { font-weight: 400; }
/* Audio delete requests on the recording card and in Report → Requests */
.rec-del { margin-left: auto; position: relative; }
.rec-del > summary { list-style: none; cursor: pointer; }
.rec-del > summary::-webkit-details-marker { display: none; }
.rec-del-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(340px, calc(100vw - 40px)); padding: 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--card-solid); box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 8px; }
.rec-del-form textarea, .rec-del-form select { width: 100%; }
.rec-del-form p { margin: 0; font-size: 13px; }
.rec-del-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.rec-del-form .check-line { flex-direction: row; align-items: center; color: var(--text); }
.rec-del-warn { color: #f5c98a; font-size: 13px; }
.rec-req { margin: 8px 0; padding: 9px 12px; border-radius: 10px; border: 1px solid; font-size: 13px; line-height: 1.55; }
.rec-req .inline-form { display: inline; }
.rec-req-wait { background: rgba(240, 163, 64, 0.1); border-color: rgba(240, 163, 64, 0.45); }
.rec-req-no { background: rgba(14, 126, 166, 0.1); border-color: rgba(14, 126, 166, 0.45); }
.rec-req-done { background: rgba(231, 76, 60, 0.08); border-color: rgba(231, 76, 60, 0.35); }
.req-card .card-actions { align-items: flex-start; }
.req-reject > summary { list-style: none; cursor: pointer; }
.req-reject > summary::-webkit-details-marker { display: none; }
.req-reject form { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.req-reject label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 420px) { .report-tabs a { padding: 8px 11px; } }
.perf-up { color: var(--green); font-weight: 700; }
@media (max-width: 420px) { .report-tabs { gap: 4px; } .report-tabs a { padding: 8px 9px; font-size: 12px; } }
/* AI picker next to "Create transcript" / "AI analysis" */
.call-ai-actions form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.engine-pick { max-width: 260px; font-size: 12px; padding: 6px 8px; min-height: 0; }
@media (max-width: 520px) { .call-ai-actions form { display: flex; width: 100%; min-width: 0; } .engine-pick { max-width: 100%; width: 100%; min-width: 0; box-sizing: border-box; flex: 1 1 100%; } }

/* User Management keeps related controls on one line as space allows. */
.user-management-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.user-management-heading .page-title { margin-bottom: 3px; }
.user-management-heading p { margin: 0; }
.user-management-heading .btn { flex: none; }
.user-filters { display: grid; grid-template-columns: minmax(130px, 1.5fr) minmax(105px, 1fr) minmax(105px, 1fr) auto; gap: 10px; align-items: end; }
.user-filters label, .user-edit-fields label { display: grid; min-width: 0; gap: 5px; font-size: 13px; color: var(--muted); }
.user-filters :is(input, select), .user-edit-fields :is(input, select) { width: 100%; min-width: 0; }
.user-filter-actions, .user-edit-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.user-edit-fields small { color: var(--muted); }
.user-status-action { margin-inline-start: auto; }
.user-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.user-list-heading, .user-list-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(68px, 1fr) minmax(70px, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; }
.user-list-heading { color: var(--muted); font-size: 12px; }
.user-list-row { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.user-identity { min-width: 0; overflow-wrap: anywhere; }
.user-identity small { display: block; color: var(--muted); }
.user-list-row .badge { justify-self: start; }
.user-edit-link { justify-self: end; }
@media (max-width: 700px) {
  .user-settings-layout .settings-nav [aria-current="page"] { order: -1; }
  .user-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-search, .user-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .user-management-heading { align-items: flex-start; }
  .user-list-heading { display: none; }
  .user-list-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px 8px; }
  .user-identity { grid-column: 1 / 3; }
  .user-role { grid-column: 1; grid-row: 2; }
  .user-list-row .badge { grid-column: 2; grid-row: 2; }
  .user-edit-link { grid-column: 3; grid-row: 1 / 3; }
  .user-edit-fields { grid-template-columns: 1fr; }
  .user-edit-actions .btn { padding-inline: 10px; }
}

.user-password-controls { display: flex; align-items: end; gap: 8px; }
.user-password-controls .user-password-input { flex: 1; }
.user-password-controls .btn { flex: none; min-height: 44px; }
.user-password-result .muted { margin: 0; }

.meeting-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.meeting-grid > .card { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.meeting-grid .card-actions, .meeting-grid .card-head { flex-wrap: wrap; }
@media (min-width: 900px) { .meeting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Share call recording (voice-share.php) */
.vs-app h2 { margin-top: 0; }
.vs-status:empty { display: none; }
.vs-file-name { word-break: break-word; margin: 4px 0 8px; }
.vs-app audio { width: 100%; margin-bottom: 10px; }
.vs-match, .vs-picked { margin: 8px 0; }
.vs-picked { padding: 10px 12px; border-radius: 10px; background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .45); }
.vs-search-label { display: block; font-weight: 600; margin: 12px 0 4px; }
#vs-search { width: 100%; font-size: 16px; padding: 12px; }
.vs-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 46vh; overflow-y: auto; }
.vs-lead { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(127, 127, 127, .35); background: rgba(127, 127, 127, .08); color: inherit; font: inherit; cursor: pointer; line-height: 1.35; }
.vs-lead.on, .vs-lead:focus { border-color: #22c55e; outline: none; }
.vs-recent-title { margin: 14px 0 4px; font-size: 15px; }
.vs-note { margin: 10px 0; }
.vs-note input { width: 100%; }
.vs-progress { height: 10px; border-radius: 6px; background: rgba(127, 127, 127, .25); overflow: hidden; margin: 10px 0; }
.vs-progress > div { height: 100%; width: 0; background: #22c55e; transition: width .2s; }
.vs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vs-actions .btn.gold { flex: 1 1 100%; font-size: 17px; padding: 14px; }
.vs-manual { margin-top: 14px; }
.vs-waiting { display: block; text-decoration: none; }

/* Settings → Meta: Ad campaign names (Meta Ads token) */
.meta-ads { margin-top: 14px; }
.meta-ads-facts { margin-top: 12px; }
.meta-ads-steps { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 8px; }
.meta-ads-step { padding: 10px 12px; border: 1px solid var(--border-2); border-left-width: 4px; border-radius: 10px; background: rgba(13,20,32,.45); }
.meta-ads-step.is-ok { border-left-color: var(--green); }
.meta-ads-step.is-warn { border-left-color: var(--amber); }
.meta-ads-step.is-bad { border-left-color: var(--red); background: rgba(231, 76, 60, .07); }
.meta-ads-step-head { margin-bottom: 3px; }
.meta-ads-fix { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.18); font-size: 13px; }
.meta-ads-fix p { margin: 0 0 6px; }
.meta-ads-fix p:last-child { margin-bottom: 0; }
.meta-ads-form { margin-top: 14px; }
.meta-ads-form small { display: block; margin-top: 6px; line-height: 1.45; }
.meta-ads-help { margin-top: 12px; border-top: 1px solid var(--border-2); padding-top: 10px; }
.meta-ads-help summary { cursor: pointer; font-weight: 700; }
.meta-ads-help ol { padding-left: 20px; display: grid; gap: 8px; margin: 10px 0; }
