/* =====================================================================
   WA CRM · hoja de estilos principal
   ===================================================================== */
:root {
  --wa-green: #25d366;
  --wa-green-dark: #1ebe5b;
  --wa-teal: #128c7e;
  --wa-teal-dark: #0b6b60;
  --wa-deep: #075e54;
  --ink: #10241f;
  --ink-soft: #334a43;
  --muted: #64748b;
  --muted-2: #8a9b96;
  --bg: #f2f6f5;
  --surface: #ffffff;
  --line: #e2ece8;
  --line-strong: #cfe0da;
  --danger: #dc3545;
  --warning: #f0a12b;
  --sidebar-w: 264px;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 31, .05), 0 1px 3px rgba(16, 36, 31, .04);
  --shadow-md: 0 8px 24px rgba(16, 36, 31, .08);
  --shadow-lg: 0 20px 50px rgba(16, 36, 31, .14);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: .925rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wa-teal); text-decoration: none; }
a:hover { color: var(--wa-deep); }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.min-w-0 { min-width: 0; }
.text-secondary { color: var(--muted) !important; }

/* ------------------------------------------------------------------ */
/* Estructura                                                          */
/* ------------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0d3f37 0%, #0a2f29 55%, #08241f 100%);
  color: #d8e9e4;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  padding: 18px 14px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.09);
  margin-bottom: 10px;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--wa-green), #12a05a);
  display: grid; place-items: center;
  color: #fff; font-size: 1.35rem;
  box-shadow: 0 6px 16px rgba(37, 211, 102, .35);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 1.06rem; letter-spacing: .02em; }
.brand-text small { color: #9cc4ba; font-size: .72rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding-top: 4px; }
.nav-group {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #7fa79d;
  font-weight: 700;
  padding: 16px 10px 7px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #cfe4de;
  padding: 9px 11px;
  border-radius: 10px;
  font-weight: 500;
  font-size: .895rem;
  margin-bottom: 2px;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-link i { font-size: 1.03rem; width: 20px; text-align: center; color: #8fb6ab; transition: color .15s; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link:hover i { color: #fff; }
.nav-link.active { background: rgba(37, 211, 102, .16); color: #fff; font-weight: 600; }
.nav-link.active i { color: var(--wa-green); }
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--wa-green);
}
.nav-badge {
  margin-left: auto;
  background: var(--wa-green);
  color: #06301f;
  font-size: .68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.sidebar-plan {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 12px;
}
.plan-label { font-size: .76rem; font-weight: 600; color: #d9ece6; }
.plan-progress { height: 5px; background: rgba(255,255,255,.12); border-radius: 99px; margin: 6px 0 4px; }
.plan-progress .progress-bar { background: var(--wa-green); border-radius: 99px; }
.plan-meta { font-size: .68rem; color: #8fb6ab; }

.sidebar-footer {
  display: flex; align-items: center; gap: 7px;
  font-size: .7rem; color: #7fa79d;
  padding: 14px 10px 2px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wa-green); box-shadow: 0 0 0 3px rgba(37,211,102,.18); }

.main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 72px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.page-heading { font-size: 1.22rem; margin: 0; line-height: 1.2; }
.page-sub { font-size: .76rem; color: var(--muted); margin-top: 3px; }

.content { padding: 24px 26px 30px; flex: 1; }
.app-footer {
  display: flex; justify-content: space-between;
  padding: 14px 26px;
  font-size: .74rem;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ */
/* Componentes                                                         */
/* ------------------------------------------------------------------ */
.card-soft {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-soft .card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-soft .card-body { padding: 18px; }

.btn { border-radius: 10px; font-weight: 600; font-size: .875rem; padding: .5rem .95rem; }
.btn-sm { padding: .34rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.25rem; font-size: .98rem; border-radius: 12px; }
.btn-brand {
  background: linear-gradient(135deg, var(--wa-teal), var(--wa-teal-dark));
  border: 1px solid var(--wa-teal-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(18, 140, 126, .22);
}
.btn-brand:hover, .btn-brand:focus { background: var(--wa-deep); border-color: var(--wa-deep); color: #fff; }
.btn-accent { background: var(--wa-green); border-color: var(--wa-green-dark); color: #06301f; }
.btn-accent:hover { background: var(--wa-green-dark); color: #06301f; }
.btn-outline-brand { border: 1px solid var(--line-strong); color: var(--ink-soft); background: #fff; }
.btn-outline-brand:hover { border-color: var(--wa-teal); color: var(--wa-teal); background: #f4fbf9; }
.btn-icon {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  padding: 0; border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}
.btn-icon:hover { background: #f4f8f7; color: var(--wa-teal); }

.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--line-strong);
  padding: .52rem .75rem;
  font-size: .875rem;
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: var(--wa-teal);
  box-shadow: 0 0 0 .2rem rgba(18, 140, 126, .14);
}
.form-label { font-size: .78rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
.form-text { font-size: .74rem; color: var(--muted-2); }
.input-group-text { border-radius: 10px; border-color: var(--line-strong); background: #f6faf9; font-size: .8rem; color: var(--muted); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: linear-gradient(145deg, #d7f5e5, #b9ecd2);
  color: #0b6b60;
  font-weight: 800;
  font-size: .8rem;
  flex: 0 0 auto;
}
.avatar-lg { width: 46px; height: 46px; font-size: .95rem; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 10px 5px 6px;
  color: var(--ink);
}
.user-chip:hover { background: #f0f7f4; }
.user-chip strong { display: block; font-size: .8rem; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: .68rem; }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  border-radius: 99px; font-size: .58rem; font-weight: 700;
  padding: 1px 4px; line-height: 1.2;
}

.badge { font-weight: 600; font-size: .7rem; padding: .34em .62em; border-radius: 7px; vertical-align: middle; }
.badge-soft-success { background: #e3f8ec; color: #0f7a43; }
.badge-soft-warning { background: #fdf1dc; color: #9a6412; }
.badge-soft-danger  { background: #fde7e9; color: #a3232f; }
.badge-soft-info    { background: #e2f1fb; color: #1f6f9e; }
.badge-soft-secondary { background: #eef2f1; color: #566863; }
.badge-soft-light   { background: #f4f7f6; color: #566863; }
.badge-soft-primary { background: #e8eefc; color: #3757a8; }
.badge-soft-dark    { background: #e7ecea; color: #2c3a36; }

/* Estadísticas */
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  height: 100%;
}
.stat-card .stat-label { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; letter-spacing: -.03em; }
.stat-card .stat-foot { font-size: .74rem; color: var(--muted-2); }
.stat-icon {
  position: absolute; top: 16px; right: 16px;
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.15rem;
}
.stat-icon.green { background: #e3f8ec; color: #0f7a43; }
.stat-icon.blue  { background: #e2f1fb; color: #1f6f9e; }
.stat-icon.orange{ background: #fdf1dc; color: #9a6412; }
.stat-icon.purple{ background: #efe8fb; color: #6b46b8; }
.stat-icon.red   { background: #fde7e9; color: #a3232f; }

.progress { background: #eef3f1; border-radius: 99px; }
.progress-bar { background: var(--wa-teal); }

/* Tablas */
.table-modern { margin: 0; font-size: .855rem; }
.table-modern > :not(caption) > * > * { padding: .7rem .8rem; border-bottom-color: var(--line); vertical-align: middle; }
.table-modern thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; background: #f8fbfa; border-bottom: 1px solid var(--line);
}
.table-modern tbody tr:hover { background: #fafcfb; }
.table-modern tbody tr:last-child td { border-bottom: 0; }

/* Pestañas */
.nav-tabs { border-bottom: 1px solid var(--line); gap: 2px; }
.nav-tabs .nav-link {
  border: 0; color: var(--muted); font-weight: 600; font-size: .85rem;
  padding: .6rem .9rem; border-bottom: 2px solid transparent; margin: 0;
  background: transparent; border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--ink); background: transparent; }
.nav-tabs .nav-link.active { color: var(--wa-teal); border-bottom-color: var(--wa-teal); background: transparent; }

/* Vacíos */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-icon {
  width: 72px; height: 72px; border-radius: 22px;
  display: grid; place-items: center; margin: 0 auto 16px;
  background: linear-gradient(145deg, #e9f8f1, #d6f1e5);
  color: var(--wa-teal); font-size: 1.9rem;
}
.empty-state h2 { font-size: 1.1rem; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }

/* Login / registro */
.auth-body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #d9f6e7 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 110%, #d3efe9 0%, transparent 50%),
              #f4f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.auth-logo {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(145deg, var(--wa-green), #0e9e5c);
  color: #fff; font-size: 1.7rem;
  display: grid; place-items: center; margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .3);
}
.auth-card h1 { font-size: 1.45rem; margin-bottom: 4px; }
.auth-card .auth-sub { color: var(--muted); font-size: .88rem; margin-bottom: 22px; }
.auth-split { display: grid; grid-template-columns: 1.05fr .95fr; max-width: 1000px; width: 100%; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-side {
  background: linear-gradient(160deg, #0d3f37, #08241f);
  color: #e8f5f0; padding: 46px 38px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,211,102,.3), transparent 70%);
  right: -120px; bottom: -100px;
}
.auth-side h2 { color: #fff; font-size: 1.55rem; line-height: 1.25; margin-bottom: 14px; }
.auth-side p { color: #a9c9c0; font-size: .9rem; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: #d5e8e2; margin-bottom: 12px; }
.auth-points i { color: var(--wa-green); margin-top: 2px; }
.auth-main { padding: 44px 40px; }

/* ------------------------------------------------------------------ */
/* Bandeja de entrada                                                  */
/* ------------------------------------------------------------------ */
.content-inbox { padding: 18px 20px 22px; display: flex; flex-direction: column; min-height: 0; }
.inbox {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 300px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: calc(100vh - 72px - 46px);
  min-height: 520px;
}
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fbfdfc; }
.inbox-list-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.inbox-search { position: relative; }
.inbox-search i { position: absolute; left: 11px; top: 9px; color: var(--muted-2); font-size: .85rem; }
.inbox-search input { padding-left: 32px; background: #fff; }
.inbox-filters { display: flex; gap: 5px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.inbox-filters::-webkit-scrollbar { display: none; }
.chip-filter {
  border: 1px solid var(--line);
  background: #fff; color: var(--muted);
  border-radius: 999px; font-size: .72rem; font-weight: 600;
  padding: 3px 10px; white-space: nowrap;
}
.chip-filter.active { background: var(--wa-teal); border-color: var(--wa-teal); color: #fff; }
.inbox-items { overflow-y: auto; flex: 1; }
.conv-item {
  display: flex; gap: 11px; padding: 12px 14px;
  border-bottom: 1px solid #eef4f2;
  cursor: pointer; position: relative;
  transition: background .12s;
}
.conv-item:hover { background: #f1f8f5; }
.conv-item.active { background: #e8f7f0; }
.conv-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wa-teal); }
.conv-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(145deg, #d9f4e7, #b7ead2);
  color: #0b6b60; font-weight: 800; font-size: .85rem;
  display: grid; place-items: center; flex: 0 0 auto;
}
.conv-body { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.conv-name { font-weight: 700; font-size: .855rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: .65rem; color: var(--muted-2); flex: 0 0 auto; }
.conv-preview { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.unread-pill { background: var(--wa-green); color: #06301f; font-weight: 800; font-size: .64rem; border-radius: 99px; padding: 1px 6px; margin-left: auto; }
.conv-tag { font-size: .6rem; padding: 1px 6px; border-radius: 99px; background: #eef3f1; color: #566863; font-weight: 700; }

.chat-panel { display: flex; flex-direction: column; min-width: 0; background: #efeae2; position: relative; }
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px; background: #f7fbfa; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-head .name { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.chat-head .sub { font-size: .72rem; color: var(--muted); }
.chat-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chat-paused-bar {
  background: #fdf1dc;
  color: #8a5a10;
  font-size: .72rem;
  font-weight: 600;
  padding: 5px 16px;
  border-bottom: 1px solid #f2e0c2;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.chat-body {
  flex: 1; overflow-y: auto; padding: 22px 26px;
  background-image: radial-gradient(rgba(11, 107, 96, .07) 1px, transparent 1px);
  background-size: 18px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.day-sep { align-self: center; background: rgba(255,255,255,.85); color: var(--muted); font-size: .66rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin: 10px 0 8px; }
.bubble {
  max-width: min(72%, 560px);
  padding: 7px 11px 6px;
  border-radius: 10px;
  font-size: .845rem;
  line-height: 1.42;
  box-shadow: 0 1px 1px rgba(11, 20, 26, .08);
  position: relative;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.bubble.in { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.bubble.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 3px; }
.bubble .meta { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: .63rem; color: #667781; margin-top: 2px; }
.bubble .meta .bi { font-size: .72rem; }
.bubble .origen { font-size: .6rem; font-weight: 700; color: var(--wa-teal); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
.bubble.pendiente { opacity: .92; }
.bubble.pendiente .meta { color: #9a6412; }
.chat-empty { margin: auto; text-align: center; color: #5b6b66; }
.chat-empty i { font-size: 2.4rem; color: #9dbcb3; }
.chat-compose { background: #f7fbfa; border-top: 1px solid var(--line); padding: 10px 14px; flex: 0 0 auto; }
.chat-compose textarea {
  border: 0; background: #fff; border-radius: 12px; resize: none;
  min-height: 42px; max-height: 140px; padding: 10px 12px; font-size: .87rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chat-compose textarea:focus { box-shadow: inset 0 0 0 1px var(--wa-teal), 0 0 0 .2rem rgba(18,140,126,.1); }
.compose-tools { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.compose-hint { font-size: .66rem; color: var(--muted-2); margin-left: auto; }

.chat-side { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; display: flex; flex-direction: column; }
.side-block { padding: 16px; border-bottom: 1px solid var(--line); }
.side-block h6 { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.side-contact { text-align: center; padding-top: 20px; }
.side-contact .conv-avatar { width: 64px; height: 64px; font-size: 1.2rem; margin: 0 auto 10px; }
.side-contact h5 { font-size: .95rem; margin-bottom: 2px; }
.side-contact .phone { font-size: .8rem; color: var(--muted); }

/* Burbujas de plantillas */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 15px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .15s, transform .15s;
}
.tpl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tpl-card .tpl-title { font-weight: 700; font-size: .86rem; }
.tpl-card .tpl-text {
  font-size: .79rem; color: var(--ink-soft); white-space: pre-wrap;
  background: #f7fbf9; border: 1px solid #eaf3ef; border-radius: 9px; padding: 9px 10px;
  max-height: 132px; overflow: hidden; position: relative;
}
.tpl-card .tpl-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.tpl-cat { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--wa-teal); }

.industria-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 11px; font-size: .76rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
}
.industria-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.industria-pill i { font-size: .85rem; }

/* Conexión WhatsAuto */
.connect-box {
  background: #0b2b26; color: #d9efe8; border-radius: 14px; padding: 16px;
  font-family: Consolas, "Courier New", monospace; font-size: .8rem; word-break: break-all;
  border: 1px solid #13453c;
}
.connect-box .lbl { color: #7fb3a4; font-family: inherit; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 5px; }
.copy-btn { border: 1px solid #2b5a4f; background: #123a32; color: #cdeae0; border-radius: 7px; font-size: .7rem; padding: 2px 8px; }

/* Mensajes de ayuda */
.help-callout { background: #f1faf5; border: 1px solid #d4eddf; border-radius: 12px; padding: 13px 15px; font-size: .82rem; color: #33564b; }
.help-callout i { color: var(--wa-teal); }

/* Toasts */
.toast { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-md); }

/* Sidebar móvil */
.sidebar-backdrop { display: none; }

@media (max-width: 1280px) {
  .inbox { grid-template-columns: 310px minmax(0, 1fr); }
  .chat-side { display: none; }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(8,35,30,.45); z-index: 1035; }
  .topbar { padding: 0 16px; height: 64px; }
  .content { padding: 18px 16px 24px; }
  .inbox { height: calc(100vh - 64px - 30px); grid-template-columns: 1fr; }
  .inbox-list { border-right: 0; }
  .inbox.has-chat .inbox-list { display: none; }
  .chat-panel { display: none; }
  .inbox.has-chat .chat-panel { display: flex; }
  .inbox:not(.has-chat) .chat-panel { display: none; }
  .chat-body { padding: 16px; }
  .bubble { max-width: 86%; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 30px 24px; }
}
@media (max-width: 575.98px) {
  .content-inbox { padding: 8px; }
  .inbox { border-radius: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .page-heading { font-size: 1.05rem; }
}
