:root {
  --wa-teal: #00a884;
  --wa-teal-dark: #008069;
  --wa-bg-outer: #eae6df;
  --wa-sidebar-bg: #ffffff;
  --wa-topbar-bg: #f0f2f5;
  --wa-chat-bg: #efeae2;
  --wa-bubble-out: #d9fdd3;
  --wa-bubble-in: #ffffff;
  --wa-blue-banner: #9de1fe;
  --wa-yellow-notice: #fff3c4;
  --wa-badge: #25d366;
  --wa-border: #e9edef;
  --wa-hover: #f5f6f6;
  --wa-active: #f0f2f5;
  --wa-text: #111b21;
  --wa-muted: #667781;
  --wa-danger: #dc2626;
  --font-main: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-urdu: 'Noto Naskh Arabic', 'Jameel Noori Nastaleeq', 'Segoe UI', Tahoma, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: var(--wa-bg-outer);
  color: var(--wa-text);
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--wa-muted); font-size: 12px; }
.text-danger { color: var(--wa-danger) !important; }
.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }

/* LOGIN VIEW */
.login-backdrop {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #dff6ee 0%, var(--wa-bg-outer) 52%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 74px 20px 24px;
  overflow-y: auto;
}

.login-top-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 230px;
  background: linear-gradient(135deg, #00a884 0%, #007a63 100%);
  display: flex;
  justify-content: center;
  padding-top: 26px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  height: 38px;
}
.brand-divider { opacity: 0.65; }
.brand-sub { font-weight: 500; letter-spacing: 0.02em; opacity: 0.92; }

.wa-brand-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 880px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(11, 20, 26, 0.16), 0 8px 18px rgba(11, 20, 26, 0.08);
  overflow: hidden;
}

.login-split {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
}

.login-showcase {
  background: linear-gradient(160deg, #f3fbf8 0%, #e6f7f0 100%);
  border-right: 1px solid #d7ede4;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.showcase-badge {
  align-self: flex-start;
  background: #fff;
  color: #008069;
  border: 1px solid #bce8d8;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.login-showcase h2 {
  font-size: 24px;
  line-height: 1.25;
  color: #111b21;
  font-weight: 700;
}
.login-showcase h2 span { color: #008069; }

.showcase-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #3b4a54;
}

.showcase-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.showcase-features li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.feat-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #d2ece2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.showcase-features strong {
  display: block;
  font-size: 13px;
  color: #111b21;
}
.showcase-features span {
  font-size: 12px;
  color: #54656f;
}

.onyx-brand-box {
  background: #fff;
  border: 1px solid #cde8dd;
  border-left: 4px solid var(--wa-teal);
  border-radius: 10px;
  padding: 12px 14px;
}
.onyx-title {
  font-size: 13px;
  font-weight: 700;
  color: #008069;
  margin-bottom: 5px;
}
.onyx-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: #3b4a54;
}
.onyx-links a {
  color: #008069;
  font-weight: 600;
  text-decoration: none;
}
.onyx-links a:hover { text-decoration: underline; }

.login-form-pane {
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-header {
  margin-bottom: 22px;
}
.login-card-header h1 { font-size: 23px; font-weight: 700; margin-bottom: 4px; color: #111b21; }
.login-card-header p { font-size: 13px; color: var(--wa-muted); }

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-ico {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
}
.input-icon-wrap input {
  width: 100%;
  padding-left: 38px;
  padding-right: 38px;
  background: #f8fafb;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.input-icon-wrap input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15);
}
.pass-eye-btn {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  opacity: 0.7;
}
.pass-eye-btn:hover { opacity: 1; }

.btn-login-cta {
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(0, 168, 132, 0.28);
  transition: transform 0.12s, background 0.15s;
}
.btn-login-cta:hover { transform: translateY(-1px); }

@media (max-width: 780px) {
  .login-split { grid-template-columns: 1fr; }
  .login-showcase { border-right: none; border-bottom: 1px solid #d7ede4; padding: 24px; }
  .login-form-pane { padding: 26px 24px; }
}

.security-pill {
  background: #e7fce3;
  color: #008069;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stack-form { display: flex; flex-direction: column; gap: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--wa-muted);
  font-weight: 500;
}

input, select, textarea {
  background: #fff;
  color: var(--wa-text);
  border: 1px solid #d1d7db;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--wa-teal); }

.login-footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--wa-border);
  font-size: 12px;
  color: var(--wa-muted);
  line-height: 1.5;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}

/* BUTTONS */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-wa { background: var(--wa-teal); color: #fff; }
.btn-wa:hover { background: var(--wa-teal-dark); }
.btn-light { background: var(--wa-topbar-bg); color: var(--wa-text); }
.btn-danger { background: var(--wa-danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* MAIN 2-PANE WHATSAPP WEB LAYOUT */
.wa-app {
  display: grid;
  grid-template-columns: 370px 1fr;
  height: 100vh;
  width: 100vw;
  background: #fff;
}

.wa-sidebar {
  background: var(--wa-sidebar-bg);
  border-right: 1px solid #d1d7db;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.wa-top-bar {
  height: 60px;
  background: var(--wa-topbar-bg);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.agent-profile, .chat-peer {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-teal);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.peer-avatar { background: #008069; }

.agent-meta { display: flex; flex-direction: column; min-width: 0; }
.agent-title, .peer-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-sub, .peer-sub {
  font-size: 12px;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-icon-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #54656f;
  font-size: 19px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-icon-btn:hover { background: rgba(11, 20, 26, 0.06); }

/* Dropdown Menu */
.dropdown-wrap { position: relative; }
.wa-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 225px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(11, 20, 26, 0.2);
  padding: 6px 0;
  z-index: 40;
}
.wa-dropdown button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--wa-text);
  cursor: pointer;
}
.wa-dropdown button:hover { background: var(--wa-hover); }
.wa-dropdown hr { border: none; border-top: 1px solid var(--wa-border); margin: 4px 0; }

/* Classic Blue WhatsApp Banner */
.wa-blue-banner {
  background: var(--wa-blue-banner);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: filter 0.15s;
}
.wa-blue-banner.connected {
  background: #d9fdd3;
}
.wa-blue-banner.waiting {
  background: #fff3c4;
}
.blue-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.blue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.blue-text strong { font-size: 13.5px; color: var(--wa-text); }
.blue-text span { font-size: 12px; color: #3b4a54; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-banner {
  border: none;
  background: #fff;
  color: var(--wa-teal-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* Search Bar */
.wa-search-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--wa-border);
  background: #fff;
}
.search-pill {
  background: var(--wa-topbar-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}
.search-ico { font-size: 13px; color: var(--wa-muted); }
.search-pill input {
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13.5px;
  width: 100%;
}

/* Chat List */
.wa-chat-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f6f6;
}
.thread-item:hover { background: var(--wa-hover); }
.thread-item.active { background: var(--wa-active); }

.thread-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dfe5e7;
  color: #54656f;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.thread-avatar.quick { background: var(--wa-teal); color: #fff; }

.thread-body { flex: 1; min-width: 0; }
.thread-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.thread-title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-time { font-size: 11.5px; color: var(--wa-muted); flex-shrink: 0; }

.thread-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.thread-sub {
  font-size: 13px;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-count {
  background: var(--wa-badge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* RIGHT CHAT PANE */
.wa-chat-pane {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--wa-chat-bg);
  position: relative;
}

.chat-top {
  border-left: 1px solid #d1d7db;
}

.pill-chip {
  background: #fff;
  border: 1px solid #d1d7db;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--wa-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pill-chip:hover { background: var(--wa-hover); }

.btn-disconnect {
  background: var(--wa-danger);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Chat Wallpaper Body */
.wa-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 48px;
  display: flex;
  flex-direction: column;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(11, 20, 26, 0.055) 1px, transparent 0);
  background-size: 20px 20px;
  position: relative;
}

.wa-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.wa-yellow-notice {
  align-self: center;
  background: var(--wa-yellow-notice);
  color: #54656f;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.1);
  max-width: 720px;
  text-align: center;
  margin-bottom: 4px;
}

.wa-date-chip {
  align-self: center;
  background: #fff;
  color: #54656f;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
  margin: 4px 0 8px;
}

.msg-row {
  display: flex;
  width: 100%;
}
.msg-row.in { justify-content: flex-start; }
.msg-row.out { justify-content: flex-end; }

.msg-bubble {
  max-width: 65%;
  padding: 7px 10px 6px 11px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
  position: relative;
}
.msg-bubble.in {
  background: var(--wa-bubble-in);
  border-top-left-radius: 0;
}
.msg-bubble.out {
  background: var(--wa-bubble-out);
  border-top-right-radius: 0;
}

.preview-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--wa-teal-dark);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.msg-text {
  font-size: 14.2px;
  line-height: 1.42;
  color: var(--wa-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-bubble.rtl-text .msg-text {
  direction: rtl;
  text-align: right;
  font-family: var(--font-urdu);
  font-size: 16.5px;
  line-height: 1.85;
}

.bubble-media img {
  max-width: 240px;
  max-height: 180px;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
}
.bubble-voice audio {
  margin-top: 4px;
  height: 34px;
  max-width: 260px;
}

.msg-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.msg-time { font-size: 11px; color: var(--wa-muted); }
.wa-ticks { font-size: 12px; color: #53bdeb; font-weight: 700; }

.wa-sending-pill {
  position: sticky;
  bottom: 8px;
  align-self: center;
  background: #fff;
  border: 1px solid var(--wa-teal);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(11, 20, 26, 0.18);
  margin-top: 12px;
}
.wa-sending-pill > div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.btn-stop {
  border: none;
  background: var(--wa-danger);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Quick Recipients Strip */
.wa-recipients-strip {
  background: #f7f8fa;
  border-top: 1px solid #d1d7db;
  padding: 8px 16px;
}
.recipients-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.strip-actions { display: flex; gap: 12px; }
.link-btn {
  border: none;
  background: transparent;
  color: var(--wa-teal-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.wa-recipients-strip textarea {
  width: 100%;
  font-size: 13px;
  padding: 7px 10px;
  resize: vertical;
}

.wa-attachment-bar {
  background: #e7fce3;
  border-top: 1px solid #ccebd0;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

/* Bottom Composer (WhatsApp White Pill Input) */
.wa-composer {
  position: relative;
  background: var(--wa-topbar-bg);
  padding: 9px 14px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.composer-pill {
  flex: 1;
  background: #fff;
  border-radius: 22px;
  padding: 6px 12px 6px 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.06);
}
.composer-pill textarea {
  flex: 1;
  border: none;
  padding: 4px 0;
  resize: none;
  font-size: 14.5px;
  max-height: 120px;
  background: transparent;
}
.composer-pill textarea.rtl-input {
  direction: rtl;
  text-align: right;
  font-family: var(--font-urdu);
  font-size: 16px;
}

.lang-switch {
  border: 1px solid #d1d7db;
  background: var(--wa-topbar-bg);
  color: var(--wa-text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 2px;
}
.lang-switch.ur {
  background: #d9fdd3;
  border-color: var(--wa-teal);
  color: var(--wa-teal-dark);
}

.wa-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--wa-teal);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-send-btn:hover { background: var(--wa-teal-dark); }
.wa-send-btn:disabled { background: #aebac1; cursor: not-allowed; }

.rec-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fee2e2;
  color: #991b1b;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wa-danger);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.btn-mini-wa, .btn-mini-cancel {
  border: none;
  border-radius: 50%;
  width: 24px; height: 24px;
  cursor: pointer;
  font-weight: 700;
}
.btn-mini-wa { background: var(--wa-teal); color: #fff; }
.btn-mini-cancel { background: #fff; color: var(--wa-danger); }

/* Popovers */
.wa-popover {
  position: absolute;
  bottom: 64px;
  left: 14px;
  width: 330px;
  max-height: 290px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(11, 20, 26, 0.2);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.templates-pop { left: 95px; width: 410px; }
.attach-pop { left: 54px; width: 240px; padding: 6px 0; }

.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--wa-text);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.attach-item:hover { background: var(--wa-hover); }

.popover-head {
  padding: 10px 14px;
  background: var(--wa-topbar-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.close-x {
  border: none;
  background: transparent;
  color: var(--wa-muted);
  cursor: pointer;
  font-size: 16px;
}

.emoji-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  overflow-y: auto;
}
.emoji-item {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.emoji-item:hover { background: var(--wa-topbar-bg); }

.popover-list {
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-pick-item {
  border: 1px solid var(--wa-border);
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}
.tpl-pick-item:hover { border-color: var(--wa-teal); background: #f8fffc; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(11, 20, 26, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 820px; }
.modal-header {
  background: var(--wa-topbar-bg);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #d1d7db;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px; overflow-y: auto; }

.qr-modal-grid {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 20px;
  align-items: center;
}
.qr-steps {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 12px;
}
.qr-box {
  width: 240px;
  height: 240px;
  border: 1px solid #d1d7db;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  background: #fff;
}
.qr-box img { max-width: 100%; max-height: 100%; }
.pairing-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--wa-border); }
.pairing-code { font-size: 20px; font-weight: 700; color: var(--wa-teal-dark); letter-spacing: 0.14em; margin-top: 6px; }

.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row-inline { display: flex; gap: 8px; }
.row-inline input { flex: 1; }

.modal-tabs { display: flex; gap: 8px; margin-top: 12px; }
.tab-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #d1d7db;
  background: var(--wa-topbar-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.tab-btn.active { border-color: var(--wa-teal); color: var(--wa-teal-dark); background: #e7fce3; }

.list-scroll {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-row {
  background: var(--wa-topbar-bg);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.list-row-actions { display: flex; gap: 5px; }

.toast-box {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #111b21;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 4px solid var(--wa-teal);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.toast.error { border-left-color: var(--wa-danger); }

@media (max-width: 820px) {
  .wa-app { grid-template-columns: 1fr; }
  .wa-chat-body { padding: 14px 14px; }
  .qr-modal-grid, .grid-two { grid-template-columns: 1fr; }
}
