/* RCS Portal — app styles */
:root {
  --rcs-primary: #017DB7;
  --rcs-dark: #0f2230;
  --rcs-sidebar: #16263a;
}

* { box-sizing: border-box; }
body { background: #f4f6f9; min-height: 100vh; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---- Layout shell ---- */
.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 248px;
  background: linear-gradient(180deg, #16263a 0%, #122032 100%);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
  overflow: hidden;
}
.sidebar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.sidebar-brand .bi,
.sidebar-brand .brand-mark .bi { color: var(--rcs-primary); }
.sidebar-brand .brand-mark { margin-right: 8px; }
.sidebar-scroll { overflow-y: auto; flex: 1; padding-bottom: 20px; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.nav-section {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7d93a8;
  padding: 16px 22px 6px;
  white-space: nowrap;
}
.sidebar .nav-link {
  color: #c4d2df;
  padding: 9px 22px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.sidebar .nav-link .bi { font-size: 1.05rem; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
  background: rgba(1,125,183,.16);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--rcs-primary);
}

/* Collapsed sidebar (desktop icon rail) */
.layout.collapsed .sidebar { width: 64px; }
.layout.collapsed .sidebar .brand-text,
.layout.collapsed .sidebar .nav-text,
.layout.collapsed .sidebar .nav-section { display: none; }
.layout.collapsed .sidebar .brand-mark { margin-right: 0; }
.layout.collapsed .sidebar .nav-link { justify-content: center; padding: 11px 0; gap: 0; }

/* ---- Main ---- */
.main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  padding: 12px 24px;
  border-bottom: 1px solid #e3e8ef;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title { font-weight: 600; font-size: 1.02rem; line-height: 1.1; color: #1f2d3d; }
.topbar-sub { font-size: .72rem; color: #7387a0; }

/* Topbar toggle button */
.btn-icon {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e3e8ef; border-radius: 9px;
  background: #fff; color: #45586e; font-size: 1.1rem;
  transition: background .15s ease, color .15s ease;
}
.btn-icon:hover { background: #f1f4f8; color: var(--rcs-primary); }

/* Topbar user chip + dropdown */
.user-chip {
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 6px;
  border: 1px solid #e3e8ef; border-radius: 999px;
  background: #fff; color: #2c3e50;
  transition: background .15s ease, border-color .15s ease;
}
.user-chip:hover { background: #f5f8fb; border-color: #d2dbe6; color: #2c3e50; }
.user-chip.dropdown-toggle::after { margin-left: 2px; color: #9aa9bd; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--rcs-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.user-chip .user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-chip .user-name { font-size: .88rem; font-weight: 600; color: #1f2d3d; }
.user-chip .user-role { font-size: .72rem; color: #7387a0; }

.content { padding: 24px; flex: 1; }

/* Sidebar backdrop (mobile drawer) — hidden by default */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1040;
  background: rgba(15, 34, 48, .45);
}

/* Mobile: sidebar slides over */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 1050; transform: translateX(-100%); transition: transform .2s ease; }
  .layout.mobile-open .sidebar { transform: translateX(0); }
  .layout.mobile-open .sidebar-backdrop { display: block; }
  .content { padding: 16px; }
}

/* ---- Cards / tables ---- */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16,30,54,.08);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .stat-label { color: #6b7c93; font-size: .85rem; }

.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,30,54,.08); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f5; font-weight: 600; }

/* ---- User avatar (initials) ---- */
.min-w-0 { min-width: 0; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700;
  background: #e7eef4; color: var(--rcs-primary);
}
.user-avatar.is-reseller { background: #e4f4fb; color: #0a8bc4; }

/* ---- Page hero (gradient header) ---- */
.page-hero {
  background: linear-gradient(120deg, #017DB7 0%, #0a5e86 55%, #0f2230 100%);
  color: #fff; border-radius: 14px; padding: 20px 24px;
  box-shadow: 0 6px 18px rgba(1,125,183,.22);
}
.page-hero h4 { font-weight: 700; }
.page-hero-sub { font-size: .82rem; color: rgba(255,255,255,.78); }
.hero-balance {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); color: #fff; font-weight: 600;
  font-size: .82rem; padding: 6px 12px; border-radius: 999px;
  backdrop-filter: blur(2px);
}

/* ---- Credentials cell (email + revealable password) ---- */
.cred-line { display: flex; align-items: center; gap: 6px; max-width: 240px; }
.cred-line .bi { flex-shrink: 0; }
.cred-pw { letter-spacing: .04em; }
.cred-btn {
  border: 0; background: none; color: #8595a6; padding: 0 2px;
  line-height: 1; cursor: pointer; font-size: .9rem;
}
.cred-btn:hover { color: var(--rcs-primary); }

/* ---- User / client list search box ---- */
.user-search { width: 260px; max-width: 60vw; }
.user-search .input-group-text { border-color: #dee2e6; }
.user-search .form-control:focus { box-shadow: none; border-color: var(--rcs-primary); }

/* ---- Auth ---- */
.auth-wrap {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f2230, #017DB7);
}
.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.auth-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 32px 30px;
  box-shadow: 0 18px 50px rgba(8, 20, 35, .28);
}
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(1, 125, 183, .12);
  color: var(--rcs-primary);
  font-size: 1.7rem;
  margin-bottom: 12px;
}
.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--rcs-dark);
}
.auth-brand p { margin: 4px 0 0; font-size: .9rem; }
.auth-card .form-label { font-weight: 500; font-size: .88rem; margin-bottom: .25rem; }
.auth-card .form-control { padding: .6rem .75rem; }
.auth-card .btn-primary {
  --bs-btn-bg: var(--rcs-primary);
  --bs-btn-border-color: var(--rcs-primary);
  --bs-btn-hover-bg: #016aa0;
  --bs-btn-hover-border-color: #016aa0;
  --bs-btn-active-bg: #015d8c;
  padding: .6rem;
  font-weight: 600;
}

/* ---- Status badges ---- */
.badge-status { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Phone preview (rich cards / templates / compose) ---- */
.phone-mock {
  width: 300px;
  background: #e9edf2;
  border: 10px solid #1c1c1c;
  border-radius: 32px;
  padding: 14px 10px;
  min-height: 560px;
  margin: 0 auto;
}
.phone-mock .chat-header {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
.phone-mock .chat-header img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.bubble {
  background: #fff; border-radius: 14px; padding: 10px 12px;
  font-size: .85rem; box-shadow: 0 1px 2px rgba(0,0,0,.08); margin-bottom: 8px;
  white-space: pre-wrap; word-break: break-word;
}
/* Locked template editor: static copy is read-only, only placeholders are inputs. */
.tpl-locked { border: 1px solid #e3e8ef; border-radius: 10px; padding: 12px; background: #f8fafc; }
.tpl-body { white-space: pre-wrap; word-break: break-word; line-height: 1.9; font-size: .9rem; }
.tpl-body .tpl-static { color: #1c2733; }
.tpl-body .tpl-ph {
  display: inline-block; min-width: 90px; width: auto;
  padding: 1px 8px; margin: 0 1px; border: 1px solid #98b6f0;
  border-radius: 6px; background: #fff; font-size: .85rem; color: #0d4bd1;
}
.tpl-body .tpl-ph:focus { outline: none; border-color: #0d6efd; box-shadow: 0 0 0 2px rgba(13,110,253,.15); }
.rc-card { background:#fff; border-radius:14px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.12); margin-bottom:8px; }
.rc-card img.media { width:100%; object-fit:cover; display:block; }
.rc-card .rc-body { padding:10px 12px; }
.rc-card .rc-title { font-weight:700; font-size:.9rem; }
.rc-card .rc-desc { font-size:.8rem; color:#444; margin-top:2px; }
.rc-suggest {
  display:inline-block; border:1px solid var(--rcs-primary); color:var(--rcs-primary);
  border-radius:18px; padding:4px 12px; font-size:.78rem; margin:3px 3px 0 0;
}
.rc-carousel { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
.rc-carousel .rc-card { min-width: 180px; max-width: 200px; margin-bottom:0; }

/* progress bars in reports */
.delivery-bar { height: 26px; border-radius: 6px; }

/* ---- Report: per-message table extras (Part 7) ---- */

/* Network cell: flag · ISO · brand · MCCMNC + generation dot */
.net-cell { line-height: 1.25; }
.net-cell .net-line { display: flex; align-items: center; gap: 5px; }
.net-cell .net-flag { font-size: 1rem; }
.net-cell .net-iso { font-weight: 600; letter-spacing: .03em; }
.net-cell .net-brand { font-size: .8rem; }
.net-cell .net-mccmnc {
  display: flex; align-items: center; gap: 6px;
  font-size: .74rem; color: #6c757d;
}
.net-cell .net-gen-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  flex: 0 0 auto;
}

/* Interaction badges below the mobile number */
.int-badge {
  display: inline-flex; align-items: center; gap: 1px;
  border-radius: 10px; padding: 1px 6px; font-size: .78rem; line-height: 1.4;
}
.int-badge small { font-size: .6rem; }

/* Failed-message error popover trigger */
.err-pop { background: transparent; cursor: pointer; line-height: 1; }
.err-pop:focus { box-shadow: none; }

/* Inline message preview (Column 3) — compact, ~220px wide */
.rcp-cell { max-width: 240px; }
.rcp-bubble {
  background: #fff; border: 1px solid #e6eaef; border-radius: 12px;
  padding: 7px 10px; font-size: .78rem; white-space: pre-wrap;
  word-break: break-word; max-width: 220px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.rcp-media {
  width: 100%; max-width: 200px; border-radius: 10px; object-fit: cover; display: block;
}
.rcp-media-full { max-width: 200px; }
.rcp-video { position: relative; display: inline-block; }
.rcp-video .rcp-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; background: rgba(0,0,0,.55); border-radius: 50%;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
}
.rcp-file {
  display: flex; align-items: center; gap: 8px; background: #f4f6f9;
  border: 1px solid #e6eaef; border-radius: 10px; padding: 8px 10px; max-width: 220px;
}
.rcp-file-icon { font-size: 1.1rem; }
.rcp-file-name { font-size: .76rem; word-break: break-all; }
.rcp-card {
  background: #fff; border: 1px solid #e6eaef; border-radius: 12px;
  overflow: hidden; max-width: 200px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.rcp-card .rcp-media { border-radius: 0; }
.rcp-card-body { padding: 7px 9px; }
.rcp-title { font-weight: 700; font-size: .78rem; }
.rcp-desc { font-size: .72rem; color: #555; margin-top: 1px; }
.rcp-carousel { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.rcp-carousel .rcp-card { min-width: 150px; max-width: 160px; }
.rcp-chips { margin-top: 4px; }
.rcp-cell .rc-suggest {
  display: inline-block; border: 1px solid var(--rcs-primary); color: var(--rcs-primary);
  border-radius: 14px; padding: 2px 8px; font-size: .68rem; margin: 3px 3px 0 0;
}

/* ---- Agent profile phone preview (banner + logo) ---- */
.phone-preview-wrap { max-width: 320px; margin: 0 auto; }
.phone-mock .phone-banner {
  height: 92px; margin: -14px -10px 0; border-radius: 22px 22px 0 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.phone-mock .phone-banner img { width: 100%; height: 100%; object-fit: cover; }
.phone-mock .phone-logo {
  width: 64px; height: 64px; border-radius: 50%; background: #fff;
  border: 3px solid var(--rcs-primary); margin: -32px auto 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 1.6rem; color: #98a8b8;
}
.phone-mock .phone-logo img { width: 100%; height: 100%; object-fit: cover; }
.phone-mock .phone-body { background: #fff; border-radius: 14px; padding: 14px; margin-top: 12px; text-align: center; }
.phone-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.phone-actions .pa-btn {
  border: 1px solid var(--rcs-primary); color: var(--rcs-primary);
  border-radius: 18px; padding: 4px 12px; font-size: .76rem;
}

/* ---- Agent status timeline ---- */
.agent-timeline { display: flex; justify-content: space-between; position: relative; }
.agent-timeline::before {
  content: ''; position: absolute; top: 16px; left: 24px; right: 24px;
  height: 2px; background: #e0e6ee; z-index: 0;
}
.agent-timeline .tl-step { position: relative; z-index: 1; text-align: center; flex: 1; }
.agent-timeline .tl-dot {
  width: 32px; height: 32px; border-radius: 50%; background: #e0e6ee; color: #889;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 6px;
  font-size: .85rem; font-weight: 600; border: 2px solid #e0e6ee;
}
.agent-timeline .tl-label { font-size: .72rem; color: #889; }
.agent-timeline .tl-step.done .tl-dot { background: #198754; border-color: #198754; color: #fff; }
.agent-timeline .tl-step.current .tl-dot {
  background: #fff; border-color: #198754; color: #198754;
  box-shadow: 0 0 0 4px rgba(25,135,84,.18);
}
.agent-timeline .tl-step.current .tl-label { color: #198754; font-weight: 600; }
.agent-timeline.rejected .tl-dot { background: #dc3545; border-color: #dc3545; color: #fff; }

/* ---- Discussion thread ---- */
.discussion-thread { max-height: 320px; overflow-y: auto; }
.disc-msg { display: flex; margin-bottom: 8px; }
.disc-msg.mine { justify-content: flex-end; }
.disc-bubble {
  max-width: 78%; padding: 8px 12px; border-radius: 12px;
  font-size: .85rem; background: #eef2f7;
}
.disc-msg.mine .disc-bubble { background: var(--rcs-primary); color: #fff; }
.disc-meta { font-size: .68rem; opacity: .7; margin-bottom: 2px; }

/* ============================================================
   Chat inbox (per-agent two-way chat) — WhatsApp-style layout
   ============================================================ */
:root {
  --wa-green:      #008069;   /* header / accents */
  --wa-green-deep: #075e54;
  --wa-bubble-out: #d9fdd3;   /* my messages */
  --wa-bubble-in:  #ffffff;   /* their messages */
  --wa-thread-bg:  #efeae2;   /* doodle paper */
  --wa-rail-bg:    #ffffff;
  --wa-hover:      #f5f6f6;
  --wa-active:     #f0f2f5;
  --wa-line:       #e9edef;
  --wa-sub:        #667781;
}

.chat-layout {
  display: grid;
  grid-template-columns: 220px 320px 1fr;
  height: calc(100vh - 170px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 12px;
}
.chat-pane-head {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--wa-sub); font-weight: 600; padding: 14px 16px;
  border-bottom: 1px solid var(--wa-line); background: #f0f2f5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Pane 1: agents rail */
.chat-agents { border-right: 1px solid var(--wa-line); display: flex; flex-direction: column; overflow: hidden; background: var(--wa-rail-bg); }
.chat-agent-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.chat-agent-item {
  width: 100%; border: 0; background: none; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid #f4f5f6; cursor: pointer; position: relative;
  transition: background .12s ease;
}
.chat-agent-item:hover { background: var(--wa-hover); }
.chat-agent-item.active { background: var(--wa-active); }
.chat-agent-item.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wa-green);
}
.chat-agent-logo {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--wa-green); color: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 1.1rem;
}
.chat-agent-logo img { width: 100%; height: 100%; object-fit: cover; }
.chat-agent-meta { min-width: 0; flex: 1; }
.chat-agent-name { display: block; font-size: .9rem; font-weight: 600; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-agent-sub { display: block; font-size: .72rem; color: var(--wa-sub); }
.chat-unread {
  font-size: .66rem; min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wa-green) !important; color: #fff; font-weight: 600;
}

/* Pane 2: conversation list */
.chat-convs { border-right: 1px solid var(--wa-line); display: flex; flex-direction: column; overflow: hidden; background: var(--wa-rail-bg); }
.chat-conv-list { overflow-y: auto; flex: 1; }
.chat-conv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid #f4f5f6; cursor: pointer;
  transition: background .12s ease;
}
.chat-conv-item:hover { background: var(--wa-hover); }
.chat-conv-item.active { background: var(--wa-active); }
.chat-conv-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: #dfe5e7; color: #8696a0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.chat-conv-main { min-width: 0; flex: 1; }
.chat-conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-conv-phone { font-size: .9rem; font-weight: 600; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-time { font-size: .68rem; color: var(--wa-sub); white-space: nowrap; flex-shrink: 0; }
.chat-conv-item.has-unread .chat-conv-time { color: var(--wa-green); font-weight: 600; }
.chat-conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.chat-conv-preview { font-size: .8rem; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chat-conv-badge {
  font-size: .66rem; min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wa-green); color: #fff; font-weight: 600; padding: 0 6px; flex-shrink: 0;
}

/* Pane 3: thread + composer */
.chat-thread-pane { display: flex; flex-direction: column; overflow: hidden; }
.chat-thread-head {
  padding: 10px 16px; border-bottom: 1px solid var(--wa-line); min-height: 60px;
  display: flex; align-items: center; background: #f0f2f5;
}
.chat-thread-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #dfe5e7; color: #8696a0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem;
}
.chat-thread-body {
  flex: 1; overflow-y: auto; padding: 18px 8%;
  background-color: var(--wa-thread-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23000000' fill-opacity='0.025'%3E%3Cpath d='M40 22a4 4 0 100 8 4 4 0 000-8zm-18 14a3 3 0 100 6 3 3 0 000-6zm40 4a3 3 0 100 6 3 3 0 000-6zM30 54a3 3 0 100 6 3 3 0 000-6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Message bubbles — WhatsApp look, scoped to the chat thread only so the
   agent discussion thread keeps its original styling. */
.chat-thread-body .disc-msg { margin-bottom: 8px; }
.chat-thread-body .disc-bubble {
  position: relative; max-width: 65%; padding: 6px 9px 8px;
  border-radius: 8px; font-size: .88rem; line-height: 1.4;
  background: var(--wa-bubble-in); color: #111b21;
  box-shadow: 0 1px .5px rgba(11,20,26,.13);
}
.chat-thread-body .disc-msg.theirs .disc-bubble { border-top-left-radius: 0; }
.chat-thread-body .disc-msg.mine .disc-bubble {
  background: var(--wa-bubble-out); color: #111b21; border-top-right-radius: 0;
}
/* little bubble tails */
.chat-thread-body .disc-msg.theirs .disc-bubble::before,
.chat-thread-body .disc-msg.mine .disc-bubble::before {
  content: ""; position: absolute; top: 0; width: 8px; height: 8px;
}
.chat-thread-body .disc-msg.theirs .disc-bubble::before {
  left: -7px; background: radial-gradient(circle at bottom right, transparent 8px, var(--wa-bubble-in) 0);
}
.chat-thread-body .disc-msg.mine .disc-bubble::before {
  right: -7px; background: radial-gradient(circle at bottom left, transparent 8px, var(--wa-bubble-out) 0);
}
.chat-thread-body .disc-meta {
  font-size: .65rem; color: var(--wa-sub); opacity: 1; margin: 2px 0 0; text-align: right;
}
.chat-text { white-space: pre-wrap; word-break: break-word; }

/* Composer */
.chat-composer {
  display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--wa-line);
  background: #f0f2f5; align-items: flex-end;
}
.chat-composer textarea {
  resize: none; border-radius: 22px; border: 1px solid var(--wa-line);
  padding: 9px 16px; background: #fff;
}
.chat-composer textarea:focus { box-shadow: none; border-color: #c9d1d6; }
.chat-composer .btn {
  border-radius: 50%; width: 42px; height: 42px; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--wa-green); border-color: var(--wa-green);
}
.chat-composer .btn:hover { background: var(--wa-green-deep); border-color: var(--wa-green-deep); }
.chat-empty { text-align: center; padding: 48px 16px; color: var(--wa-sub); }

@media (max-width: 992px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-agents, .chat-convs { border-right: 0; border-bottom: 1px solid var(--wa-line); max-height: 240px; }
  .chat-thread-body { padding: 16px; min-height: 340px; }
  .chat-thread-body .disc-bubble { max-width: 82%; }
}

/* Chat — bot-disabled notice + dimmed composer */
.chat-bot-off {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: .82rem;
  color: #8a6d3b; background: #fcf3da; border-top: 1px solid #f3e3b3;
}
.chat-bot-off .bi { font-size: 1rem; }
.chat-composer-off { opacity: .55; }
.chat-composer-off textarea { background: #f1f3f5; }

/* ── 2FA / Account Security ─────────────────────────────────────────────── */
.rcs-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.1rem;
  flex-shrink: 0;
}
/* Large spaced OTP code input */
.totp-input {
  font-family: var(--bs-font-monospace, monospace);
  letter-spacing: 0.3em;
  font-size: 1.25rem;
  font-weight: 600;
}
