/* ==========================================================================
   Whatsapp Integrated — stylesheet
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e3e8f0;
  --line-strong: #cbd5e1;

  --primary: #1e3a82;
  --primary-hover: #172e68;
  --primary-soft: #eef2fb;
  --primary-ring: rgba(30, 58, 130, 0.16);

  --green: #0f9d76;
  --green-soft: #e7f8f1;
  --red: #d64545;
  --red-soft: #fdecec;
  --amber: #c47b12;
  --amber-soft: #fdf4e3;
  --indigo: #3458b8;
  --indigo-soft: #edf1fd;

  --sidebar: #111c33;
  --sidebar-soft: #1b2947;
  --sidebar-ink: #aebbcf;
  --sidebar-active: #24365c;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px -16px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 30px 80px -28px rgba(15, 23, 42, 0.5);

  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.012em; }
p { margin: 0; }
img { max-width: 100%; }

.hidden { display: none !important; }
.mono { font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }

/* ---------------- alerts ---------------- */
.alert {
  display: none;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert.show { display: block; }
.alert.info { background: var(--primary-soft); border-color: #d4def4; color: #26437f; }
.alert.warn { background: var(--amber-soft); border-color: #f3ddb4; color: #8a560c; }
.alert.error { background: var(--red-soft); border-color: #f6cccc; color: #a52f2f; }
.alert.success { background: var(--green-soft); border-color: #c5ecdd; color: #0a7356; }
#authError { margin-bottom: 14px; }

/* ---------------- brand ---------------- */
.brand { display: flex; align-items: center; gap: 11px; }
.logo-badge {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2b4d9e, #14295c);
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: 0 8px 20px -10px rgba(30, 58, 130, 0.9);
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(2, 6, 23, 0.28));
}
.brand-logo-lg { width: 46px; height: 46px; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.72; }

/* ==========================================================================
   LOGIN
   ========================================================================== */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #dbe4f3;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(64, 105, 200, 0.42), transparent 62%),
    radial-gradient(700px 440px at 100% 110%, rgba(35, 78, 160, 0.35), transparent 60%),
    linear-gradient(155deg, #14264d 0%, #0d1830 55%, #0a1327 100%);
}
.auth-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 20%, black, transparent 72%);
  pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand-name { color: #fff; }
.auth-hero .brand-sub { color: #8fa4c8; }
.auth-hero h1 {
  font-size: clamp(30px, 3.4vw, 45px);
  line-height: 1.12;
  color: #fff;
  margin: 48px 0 18px;
  max-width: 620px;
  letter-spacing: -0.03em;
}
.auth-hero p {
  color: #a8b8d2;
  font-size: 15.5px;
  max-width: 520px;
  line-height: 1.65;
}
.auth-features { margin-top: 36px; display: grid; gap: 13px; max-width: 540px; }
.auth-features div { display: flex; gap: 11px; align-items: flex-start; color: #c4d0e3; font-size: 13.5px; }
.auth-features .check {
  width: 19px; height: 19px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(56, 189, 148, 0.14);
  color: #4bd3a6; font-size: 11px; font-weight: 700;
  margin-top: 1px;
}
.auth-footer-note {
  margin-top: 48px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; color: #7c8fae; letter-spacing: 0.02em;
}

.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; background: #fff; gap: 26px;
}
.auth-card { width: 100%; max-width: 390px; }
.auth-card-head { margin-bottom: 24px; }
.auth-card h2 { font-size: 24px; letter-spacing: -0.025em; }
.auth-card .sub { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.auth-tip {
  margin-top: 20px; padding: 12px 14px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12.5px; color: var(--muted);
}
.auth-tip b { color: var(--ink-soft); }
.auth-copy { font-size: 11.5px; color: #94a3b8; }

/* ---------------- forms ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: #9aa7ba; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint b { color: var(--ink-soft); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 15px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  background: var(--primary); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; padding: 10px 16px; }
.btn.primary { background: var(--primary); }
.btn.ghost { background: #fff; color: var(--ink-soft); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-soft); }
.btn.soft { background: var(--primary-soft); color: var(--primary); border-color: #d7e0f3; }
.btn.soft:hover { background: #e3eafa; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #0b8663; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #bd3838; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.tiny { padding: 1px 5px; font-size: 11px; border-radius: 5px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.18s ease; }
.shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.sidebar-collapsed .sidebar { padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; overflow: hidden; }

.sidebar {
  background: linear-gradient(180deg, #13203c 0%, #0d1729 100%);
  color: var(--sidebar-ink);
  padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  z-index: 40;
  transition: padding 0.18s ease, opacity 0.14s ease;
}
.sidebar .brand { padding: 0 8px; margin-bottom: 24px; }
.sidebar .brand-name { color: #fff; font-size: 14.5px; }
.sidebar .brand-sub { color: #7186a8; letter-spacing: 0.12em; }
.sidebar .logo-badge { width: 36px; height: 36px; border-radius: 10px; font-size: 12.5px; }
.sidebar .brand-logo { width: 36px; height: 36px; filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.45)); }

.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: #667b9d; margin: 16px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 11px; border: 0; border-radius: 8px;
  background: transparent; color: var(--sidebar-ink);
  font-size: 13.5px; font-weight: 500; text-align: left;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.055); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 #6f93e0; }
.nav-item.active .ico { color: #9db9f0; }
.nav-item .ico { width: 18px; height: 18px; display: grid; place-items: center; color: #8ea2c2; flex-shrink: 0; }
.nav-item .ico svg { width: 17px; height: 17px; }
.nav-item.logout { margin-top: 6px; color: #b7c3d7; }
.sidebar .spacer { flex: 1; min-height: 14px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px; padding: 9px 10px; margin-top: 8px;
}
.avatar {
  width: 31px; height: 31px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #3a5caa, #1d3975);
  color: #fff; font-weight: 700; font-size: 12.5px;
}
.user-chip .meta { min-width: 0; }
.user-chip .name { color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .role { color: #8398ba; font-size: 10.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { min-width: 0; }
.topbar h2 { font-size: 16.5px; letter-spacing: -0.02em; }
.topbar-sub { font-size: 11.5px; color: var(--muted); margin-top: -1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .status-pill { margin-left: auto; flex-shrink: 0; }
.menu-btn { display: none; }
.sidebar-toggle { color: var(--ink-soft); }
.sidebar-toggle:hover { background: var(--primary-soft); border-color: #d7e0f3; color: var(--primary); }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 5px 11px; font-size: 12px; font-weight: 600;
  background: #f1f5f9; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
button.status-pill:hover { background: #e8eef7; }
.status-pill.is-on { background: var(--green-soft); color: #0a7356; border-color: #c9ecdf; }
.status-pill.is-warn { background: var(--amber-soft); color: #8a560c; border-color: #f3ddb4; }
.status-pill.is-off { background: #f1f5f9; color: #5b6b82; border-color: var(--line); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.dot.on { background: #14a37f; box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.16); }
.dot.warn { background: #d18a1c; box-shadow: 0 0 0 3px rgba(196, 123, 18, 0.16); }
.dot.off { background: #94a3b8; }

.content { padding: 26px 28px 64px; max-width: 1260px; width: 100%; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 35; }
.sidebar-backdrop.show { display: block; }

/* ==========================================================================
   CARDS, GRIDS, STATS
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card.pad { padding: 22px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-head h3 { font-size: 15px; letter-spacing: -0.015em; }
.section-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: 0.9; }
.stat .label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.055em; }
.stat .value { font-size: 29px; font-weight: 700; letter-spacing: -0.03em; margin-top: 3px; line-height: 1.2; }
.stat .value-sm { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-top: 9px; letter-spacing: -0.01em; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.accent-blue::before { background: #2f55a8; }
.stat.accent-green::before { background: var(--green); }
.stat.accent-amber::before { background: #cf8a1e; }
.stat.accent-red::before { background: var(--red); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: #0a7356; }
.badge.red { background: var(--red-soft); color: #a52f2f; }
.badge.amber { background: var(--amber-soft); color: #8a560c; }
.badge.grey { background: #f1f5f9; color: #5b6b82; }
.badge.indigo { background: var(--indigo-soft); color: var(--indigo); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: var(--surface-soft); font-weight: 700; white-space: nowrap;
}
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
td .mono { font-size: 12px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-title { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }

/* ==========================================================================
   BULK COMPOSER
   ========================================================================== */

.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.step:hover { border-color: var(--line-strong); color: var(--ink-soft); }
.step .n {
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center;
  background: #eef2f7; color: #5b6b82; font-size: 10.5px; font-weight: 700;
}
.step.on { border-color: #c3d0ea; background: var(--primary-soft); color: var(--primary); }
.step.on .n { background: var(--primary); color: #fff; }
.step.done { border-color: #c9ecdf; background: var(--green-soft); color: #0a7356; }
.step.done .n { background: var(--green); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 8px 13px; border: 0; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink-soft); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-soft);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-sm { padding: 18px; }
.dz-title { font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }

.map-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.map-grid .field { margin: 0; }
.map-grid label { font-size: 11.5px; }
.map-grid-one { grid-template-columns: minmax(0, 340px); }

/* definisi variabel pesan */
.var-defs {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.var-defs-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.var-defs-head .hint { margin-top: 2px; }
.var-def {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 34px;
  align-items: end; gap: 10px; margin-bottom: 10px;
}
.var-def .field { margin: 0; }
.var-input { display: flex; align-items: center; gap: 6px; }
.var-input .input { flex: 1; min-width: 0; }
.var-brace { color: var(--muted); font-weight: 700; font-size: 13px; }
.var-def-del {
  width: 34px; height: 38px; font-size: 18px; line-height: 1;
  color: var(--muted); background: #fff;
}
.var-def-del:hover { color: var(--red); border-color: #f0c9c9; background: var(--red-soft); }

/* pratinjau kolom A–Z */
.preview-table .col-no { width: 40px; text-align: right; color: var(--muted); font-size: 11.5px; }
.preview-table .col-letter {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--ink-soft);
}
.preview-table .col-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); display: inline-block; }
.preview-table .col-name {
  display: block; font-size: 10.5px; font-weight: 500;
  color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}

.preview-table { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.preview-table table th { position: sticky; top: 0; z-index: 1; }

.media-preview { display: flex; align-items: center; gap: 14px; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.media-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.tab-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tab-actions .hint { margin-right: auto; }

/* variable picker */
.var-picker { position: relative; display: inline-block; }
.var-menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  width: 320px; max-width: 90vw;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px;
  box-shadow: var(--shadow-md);
}
.var-menu .input { width: 100%; }
.var-list { max-height: 240px; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 1px; }
.var-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink);
}
.var-item:hover, .var-item:focus-visible { background: var(--primary-soft); outline: none; }
.var-name { font-weight: 600; font-size: 12.5px; color: var(--primary); white-space: nowrap; }
.var-val { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-empty { padding: 14px 8px; text-align: center; font-size: 12px; color: var(--muted); }

.template-sample { background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.template-sample .sample-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: #eef2f7; padding: 6px 12px; border-bottom: 1px solid var(--line);
}
.template-sample .sample-body { padding: 11px 13px; font-size: 13px; white-space: normal; max-height: 180px; overflow: auto; line-height: 1.6; }

/* send options */
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.radio-card:hover { border-color: var(--line-strong); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card span { display: flex; flex-direction: column; gap: 2px; }
.radio-card b { font-size: 13px; }
.radio-card small { font-size: 11.5px; color: var(--muted); }
.radio-card:has(input:checked) { border-color: #b9c8e6; background: var(--primary-soft); }

.summary-box {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.summary-item { display: flex; flex-direction: column; gap: 2px; }
.summary-value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.summary-label { font-size: 11.5px; color: var(--muted); }

.progress { height: 7px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #2f55a8, #4a78cf); border-radius: 999px; transition: width 0.4s ease; }
.progress-lg { height: 10px; }

.mini-stat { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.mini-value { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.mini-label { display: block; font-size: 11.5px; color: var(--muted); }

/* ==========================================================================
   QR / SESSION
   ========================================================================== */

.session-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-box { display: grid; place-items: center; padding: 24px; text-align: center; min-height: 356px; }
.qr-img { width: 250px; height: 250px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.qr-box .placeholder {
  width: 100%; max-width: 280px; min-height: 280px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; background: var(--surface-soft); border: 1px dashed var(--line-strong);
  color: var(--muted); padding: 20px;
}
.placeholder-title { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ==========================================================================
   AUTO-REPLY
   ========================================================================== */

.engine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.engine-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.engine-label { display: block; font-size: 11.5px; color: var(--muted); }
.engine-value { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; }
.engine-value.small { font-size: 12px; font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid #d7e0f3; font-size: 11.5px; font-weight: 500;
}

.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 8px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tag-list { display: contents; }
.tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 8px; border-radius: 6px;
  background: var(--primary-soft); border: 1px solid #d7e0f3;
  color: var(--primary); font-size: 12px; font-weight: 500;
}
.tag-text { white-space: nowrap; }
.tag-x {
  border: 0; background: transparent; color: #5d7ab5; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 4px;
}
.tag-x:hover { background: #dbe4f6; color: #1a3068; }
.tag-field { flex: 1; min-width: 180px; border: 0; outline: none; padding: 4px 2px; background: transparent; }

/* switch */
.switch { position: relative; display: inline-flex; width: 38px; height: 21px; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background 0.18s; }
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3); transition: transform 0.18s;
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--primary-ring); }

/* ==========================================================================
   DASHBOARD EXTRAS
   ========================================================================== */

.tips-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip-no { font-size: 11px; font-weight: 700; color: #8195b8; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; letter-spacing: 0.04em; }
.tip b { font-size: 13px; }
.tip p { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ==========================================================================
   MODAL, TOAST, LOADING
   ========================================================================== */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 22px;
}
.modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 620px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.16s ease;
}
.modal.wide { max-width: 860px; }
@keyframes modalIn { from { transform: translateY(8px) scale(0.99); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h3 { font-size: 15px; }
.modal-head .x {
  margin-left: auto; border: 0; background: #f1f5f9;
  width: 28px; height: 28px; border-radius: 7px;
  cursor: pointer; font-size: 18px; line-height: 1; color: #5b6b82;
}
.modal-head .x:hover { background: #e6ebf3; color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0; background: #fff; border-bottom-left-radius: 14px; border-bottom-right-radius: 14px;
}
.confirm-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.confirm-text b { color: var(--ink); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast {
  background: #16233d; color: #fff;
  padding: 11px 15px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow-md);
  max-width: 380px; line-height: 1.45;
  animation: toastIn 0.18s ease;
  transition: opacity 0.22s, transform 0.22s;
}
.toast.out { opacity: 0; transform: translateY(4px); }
.toast.success { background: #0d6b52; }
.toast.error { background: #962f2f; }
.toast.warn { background: #8a560c; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

.loading-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 90px 20px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid #dbe3f0; border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--muted); font-weight: 600; }

/* ==========================================================================
   FINISHING TOUCHES
   ========================================================================== */

::selection { background: rgba(30, 58, 130, 0.16); }

.content > * { animation: fadeUp 0.2s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }

.btn:focus-visible,
.nav-item:focus-visible,
.icon-btn:focus-visible,
.tab:focus-visible,
.step:focus-visible,
.var-item:focus-visible,
.status-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sidebar::-webkit-scrollbar,
.var-list::-webkit-scrollbar,
.preview-table::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.sidebar::-webkit-scrollbar-thumb,
.var-list::-webkit-scrollbar-thumb,
.preview-table::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #c9d3e2; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.sidebar::-webkit-scrollbar-thumb { background: #34486c; background-clip: padding-box; }
.sidebar::-webkit-scrollbar-track,
.var-list::-webkit-scrollbar-track,
.preview-table::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track { background: transparent; }

.card.pad > .section-head:first-child { margin-top: -2px; }
.field:last-child { margin-bottom: 0; }
.hint + .btn { margin-top: 10px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.badge.dotless { padding-left: 9px; }

/* ==========================================================================
   CHAT (WhatsApp Web-like)
   ========================================================================== */

.session-row { cursor: pointer; transition: background 0.12s; }
.session-row td { transition: background 0.12s; }
.session-row:hover td { background: var(--primary-soft); }
.session-row.is-active td { background: #fbfdff; }
.session-row.is-active:hover td { background: #fbfdff; }
.session-row.is-busy td { opacity: 0.6; pointer-events: none; }

.chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  height: 640px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.chat-list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-soft); }
.chat-search { padding: 10px; border-bottom: 1px solid var(--line); }
.chat-search .input { width: 100%; }
.chat-filters { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.chat-filter {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex: none;
}
.chat-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-filter:hover:not(.active) { background: var(--surface-soft); }
.chat-items { flex: 1; overflow-y: auto; min-height: 0; }
.chat-item {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid #edf2f8; background: transparent;
  padding: 10px 12px; cursor: pointer; font: inherit; color: inherit;
}
.chat-item:hover { background: #fff; }
.chat-item.active { background: #fff; box-shadow: inset 3px 0 0 var(--green); }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.group { background: var(--amber-soft); color: var(--amber); }
.chat-meta { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-time { font-size: 10.5px; color: var(--muted); flex: none; }
.chat-last { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--green); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; flex: none;
}
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: #f4f6fb; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.chat-head-meta { min-width: 0; display: grid; flex: 1; }
.chat-head-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-meta .small { font-size: 11px; }
.chat-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--green); font-weight: 600; }
.chat-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.14); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 7px; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble {
  max-width: 74%; padding: 7px 10px 6px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 12.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.msg-row.out .msg-bubble { background: var(--green-soft); border-color: #c6ecdd; }
.msg-meta { display: flex; justify-content: flex-end; gap: 6px; margin-top: 3px; font-size: 10px; color: var(--muted); }
.msg-mark { font-weight: 700; color: var(--green); }
.chat-compose { display: flex; gap: 8px; padding: 11px 14px; background: #fff; border-top: 1px solid var(--line); }
.chat-compose .input { flex: 1; }
.chat-empty { margin: auto; padding: 24px; text-align: center; color: var(--muted); display: grid; gap: 6px; place-items: center; max-width: 320px; }
.chat-empty-title { font-weight: 600; color: var(--ink-soft); font-size: 13.5px; }
.chat-locked { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center; background: var(--surface-soft); }
.chat-error { color: var(--red); }

/* info panel */
.chat-info-pane {
  display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line);
  background: #fff; overflow-y: auto;
}
.chat-info-pane.hidden { display: none; }
.chat-info-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.chat-info-body { padding: 18px 14px; display: grid; gap: 12px; text-align: center; }
.info-avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 26px; overflow: hidden;
}
.info-avatar img { width: 100%; height: 100%; object-fit: cover; }
.info-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.info-phone { font-size: 12.5px; color: var(--muted); }
.info-row { display: flex; justify-content: center; gap: 8px; }
.info-section { text-align: left; }
.info-section b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.info-kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.label-list { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px;
  cursor: pointer; background: #fff;
}
.label-chip input { margin: 0; }
.chat-item {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid #edf2f8; background: transparent;
  padding: 10px 12px; cursor: pointer; font: inherit; color: inherit;
}
.chat-item:hover { background: #fff; }
.chat-item.active { background: #fff; box-shadow: inset 3px 0 0 var(--green); }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
}
.chat-avatar.group { background: var(--amber-soft); color: var(--amber); }
.chat-meta { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-time { font-size: 10.5px; color: var(--muted); flex: none; }
.chat-last { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-unread {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--green); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; flex: none;
}
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: #f4f6fb; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.chat-head-meta { min-width: 0; display: grid; }
.chat-head-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-meta .small { font-size: 11px; }
.chat-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--green); font-weight: 600; }
.chat-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.14); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 7px; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble {
  max-width: 74%; padding: 7px 10px 6px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 12.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.msg-row.out .msg-bubble { background: var(--green-soft); border-color: #c6ecdd; }
.msg-meta { display: flex; justify-content: flex-end; gap: 6px; margin-top: 3px; font-size: 10px; color: var(--muted); }
.msg-mark { font-weight: 700; color: var(--green); }
.chat-compose { display: flex; gap: 8px; padding: 11px 14px; background: #fff; border-top: 1px solid var(--line); }
.chat-compose .input { flex: 1; }
.chat-empty { margin: auto; padding: 24px; text-align: center; color: var(--muted); display: grid; gap: 6px; place-items: center; max-width: 320px; }
.chat-empty-title { font-weight: 600; color: var(--ink-soft); font-size: 13.5px; }
.chat-locked { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center; background: var(--surface-soft); }
.chat-error { color: var(--red); }

.ar-media-preview { min-height: 72px; display: grid; place-items: center; }
.ar-media-preview img { max-width: 100%; max-height: 120px; border-radius: 8px; object-fit: contain; }
.media-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.media-file { display: flex; align-items: center; gap: 8px; padding: 8px; }
.media-file-icon { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 8px; border-radius: 6px; }
.media-file-name { font-size: 12px; color: var(--ink-soft); word-break: break-all; }
.media-empty { color: var(--muted); font-size: 12px; padding: 10px; }

.qr-done {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green);
  font-size: 26px; font-weight: 700;
}

/* ==========================================================================
   CHAT WHATSAPP WEB (override)
   ========================================================================== */

.chat-shell { grid-template-columns: 30% minmax(0, 1fr) 320px; height: 680px; border: 1px solid #d1d7db; border-radius: 0; box-shadow: 0 1px 1px 0 rgba(0,0,0,.06), 0 2px 5px 0 rgba(0,0,0,.06); }
.chat-list-pane { border-right: 1px solid #e9edef; background: #fff; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #f0f2f5; border-bottom: 1px solid #e9edef; }
.chat-list-head b { font-size: 20px; color: #111b21; }
.chat-search { padding: 8px 12px; background: #fff; border-bottom: 1px solid #e9edef; }
.chat-search .input { width: 100%; background: #f0f2f5; border: 0; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.chat-search .input:focus { outline: none; background: #fff; box-shadow: 0 0 0 1px #00a884; }
#menuBtn { display: none !important; }
#sidebarToggle { margin-left: -10px; }
.chat-filters { display: flex; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e9edef; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.android-preview { display: grid; place-items: center; }
.android-phone { width: 260px; background: #111; border-radius: 28px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.android-screen { background: #efeae2; border-radius: 20px; overflow: hidden; min-height: 360px; display: flex; flex-direction: column; }
.android-chat-head { background: #075e54; color: #fff; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.android-chat-body { padding: 10px; display: grid; gap: 6px; flex: 1; }
.android-chat-body .template-sample { margin: 0; }
.android-chat-body .msg-bubble { max-width: 85%; font-size: 13px; }
.chat-filter { border: 0; background: #f0f2f5; color: #54656f; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; flex: none; }
.chat-filter.active { background: #d9fdd3; color: #00a884; }
.chat-filter:hover:not(.active) { background: #e9edef; }
.chat-items { flex: 1; overflow-y: auto; min-height: 0; background: #fff; }
.chat-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f2f5; background: #fff; padding: 12px 16px; cursor: pointer; font: inherit; color: inherit; }
.chat-item:hover { background: #f5f6f6; }
.chat-item.active { background: #f0f2f5; }
.chat-avatar { width: 49px; height: 49px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #dfe3e5; color: #54656f; font-weight: 500; font-size: 16px; letter-spacing: 0.02em; overflow: hidden; position: relative; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.group { background: #d9fdd3; color: #00a884; }
.chat-meta { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-name { font-size: 16px; font-weight: 400; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-time { font-size: 12px; color: #667781; flex: none; }
.chat-last { font-size: 13px; color: #667781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #25d366; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: #efeae2; position: relative; }
.chat-thread-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #f0f2f5; border-bottom: 1px solid #e9edef; position: relative; z-index: 1; }
.chat-head-meta { min-width: 0; display: grid; flex: 1; }
.chat-head-meta b { font-size: 16px; font-weight: 500; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-meta .small { font-size: 13px; color: #667781; }
.chat-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #00a884; font-weight: 500; }
.chat-live i { width: 7px; height: 7px; border-radius: 50%; background: #00a884; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 6% 8px; display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.msg-date-sep { display: flex; justify-content: center; margin: 8px 0; }
.msg-date-sep span { background: #e1f3fb; color: #54656f; font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 0.5px rgba(0,0,0,.13); }
.msg-row { display: flex; margin-bottom: 2px; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble { max-width: 65%; width: fit-content; padding: 6px 7px 8px 9px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: #111b21; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 0.5px rgba(0,0,0,.13); position: relative; }
.msg-row:not(.out) .msg-bubble { background: #fff; border-top-left-radius: 0; }
.msg-row.out .msg-bubble { background: #d9fdd3; border-top-right-radius: 0; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: #667781; }
.msg-mark { font-weight: 700; color: #53bdeb; }
.chat-compose { display: flex; gap: 8px; padding: 8px 16px; background: #f0f2f5; border-top: 1px solid #e9edef; align-items: center; position: relative; z-index: 1; }
.chat-compose .input { flex: 1; background: #fff; border: 0; border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.chat-compose .input:focus { outline: none; }
.chat-info-pane { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; max-width: 100%; display: flex; flex-direction: column; min-height: 0; background: #fff; overflow-y: auto; transform: translateX(100%); transition: transform .2s ease; z-index: 15; box-shadow: -2px 0 12px rgba(0,0,0,.08); }
.chat-info-pane.open { transform: translateX(0); }
.chat-info-pane.hidden { display: flex; }
.chat-info-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #e9edef; font-size: 16px; color: #111b21; background: #f0f2f5; }
.chat-info-body { padding: 20px 16px; display: grid; gap: 12px; text-align: center; }
.info-avatar { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: #dfe3e5; color: #54656f; font-weight: 500; font-size: 48px; overflow: hidden; }
.info-avatar img { width: 100%; height: 100%; object-fit: cover; }
.info-name { font-size: 20px; font-weight: 400; color: #111b21; }
.info-phone { font-size: 14px; color: #667781; }
.info-row { display: flex; justify-content: center; gap: 8px; }
.info-section { text-align: left; margin-top: 8px; }
.info-section b { display: block; font-size: 13px; color: #00a884; margin-bottom: 8px; font-weight: 400; }
.info-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; color: #111b21; }
.label-list { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #e9edef; border-radius: 16px; font-size: 12.5px; cursor: pointer; background: #fff; color: #111b21; }
.label-chip input { margin: 0; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 262px; height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px -30px rgba(2, 6, 23, 0.7);
  }
  .sidebar.open { transform: translateX(0); }
  .shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell.sidebar-collapsed .sidebar { opacity: 1; pointer-events: auto; padding: 22px 14px 16px; }
  .menu-btn { display: inline-grid; }
  .sidebar-toggle { display: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 56px; }
  .session-grid, .grid.cols-2 { grid-template-columns: 1fr; }
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-list-pane { max-height: 300px; }
  .chat-thread { min-height: 420px; }
  .chat-info-pane { max-height: 300px; }
  .engine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-options { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engine-grid { grid-template-columns: 1fr; }
  .topbar-sub { display: none; }
  .topbar h2 { font-size: 15.5px; }
  .card.pad { padding: 16px; }
  .content { padding: 16px 12px 50px; }
  .section-head { flex-wrap: wrap; }
  .section-head .right { margin-left: 0; width: 100%; }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: 94vh; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .qr-box { min-height: 300px; }
  .qr-img { width: 220px; height: 220px; }
  .qr-box .placeholder { min-height: 240px; }
  .tab-actions .hint { width: 100%; margin-right: 0; }
  #toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 26px 20px; }
  .map-grid { grid-template-columns: 1fr; }
  .var-def { grid-template-columns: 1fr; gap: 8px; }
  .var-def-del { justify-self: start; }
  .status-pill span:last-child { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

/* ==== WA-like message polish (OpenWA style) ==== */
.chat-thread {
  background-color: #efeae2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%23d4cfc4' stroke-opacity='0.35' stroke-width='1'%3E%3Cpath d='M32 40h24l4 8-16 12-12-20z'/%3E%3Ccircle cx='90' cy='55' r='10'/%3E%3Cpath d='M150 30l10 18h-20z'/%3E%3Cpath d='M210 45c6 0 10 4 10 10s-4 10-10 10-10-4-10-10 4-10 10-10z'/%3E%3Cpath d='M40 120l14-8 14 8-14 8z'/%3E%3Crect x='95' y='110' width='16' height='16' rx='3'/%3E%3Cpath d='M160 120h18M169 111v18'/%3E%3Ccircle cx='220' cy='125' r='7'/%3E%3Cpath d='M30 200c10-12 22-12 32 0'/%3E%3Cpath d='M105 190l8 8-8 8-8-8z'/%3E%3Ccircle cx='170' cy='200' r='9'/%3E%3Cpath d='M215 190l6 10 10 2-8 7 2 10-10-6-10 6 2-10-8-7 10-2z'/%3E%3C/g%3E%3C/svg%3E");
}
.chat-msgs { padding: 12px 7% 10px; gap: 2px; }
.msg-row { margin: 1px 0; }
.msg-bubble {
  position: relative;
  max-width: 65%;
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  border: none;
  box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
  font-size: 14.2px;
  line-height: 19px;
  color: #111b21;
}
.msg-row:not(.out) .msg-bubble { background: #ffffff; border-top-left-radius: 0; margin-left: 8px; }
.msg-row.out .msg-bubble { background: #d9fdd3; border-top-right-radius: 0; margin-right: 8px; }
.msg-row:not(.out) .msg-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 0; height: 0;
  border-top: 0 solid transparent;
  border-right: 8px solid #ffffff;
  border-bottom: 10px solid transparent;
}
.msg-row.out .msg-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 0; height: 0;
  border-top: 0 solid transparent;
  border-left: 8px solid #d9fdd3;
  border-bottom: 10px solid transparent;
}
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-meta {
  float: right;
  position: relative;
  top: 4px;
  margin: 0 0 -4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  line-height: 15px;
  color: rgba(17,27,33,.55);
}
.msg-mark { color: rgba(17,27,33,.45); font-size: 15px; letter-spacing: -2px; }
.msg-mark.read { color: #53bdeb; }
.msg-row.out .msg-mark { color: rgba(17,27,33,.45); }
.msg-row.out .msg-mark.read { color: #53bdeb; }
.msg-date-sep { margin: 12px 0 8px; }
.msg-date-sep span {
  background: rgba(255,255,255,.92);
  color: #54656f;
  font-size: 12.5px;
  padding: 5px 12px 6px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
  text-transform: none;
}
.chat-thread-head { background: #f0f2f5; border-bottom: 1px solid #e9edef; padding: 10px 16px; }
.chat-compose { background: #f0f2f5; border-top: 1px solid #e9edef; padding: 10px 16px; }
.chat-compose .input {
  background: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  box-shadow: none;
}
.chat-compose .input:focus { outline: none; box-shadow: none; }
.chat-compose .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; }
.chat-list-pane { background: #fff; }
.chat-item { padding: 12px 15px; border-bottom: 1px solid #e9edef; }
.chat-item.active { background: #f0f2f5; box-shadow: none; }
.chat-item:hover { background: #f5f6f6; }
.chat-unread { background: #25d366; }

.chat-compose .btn {
  border-radius: 24px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: #00a884;
  border: 1px solid #00a884;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-compose .btn:hover:not(:disabled) { background: #008f6f; border-color: #008f6f; }
.chat-compose .btn:disabled { opacity: .6; }

/* ==== Sessions page - OpenWA-like grid ==== */
.sessions-page { display: grid; gap: 16px; }
.sessions-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sessions-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sessions-toolbar .search-input { flex: 1; min-width: 220px; max-width: 420px; }
.sessions-toolbar .search-input .input { width: 100%; }
.sessions-toolbar .filter-group { min-width: 220px; }
.sessions-toolbar .filter-group .input { width: 100%; }
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.session-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.session-card.is-main { border-color: #bfe8d8; box-shadow: 0 0 0 1px rgba(15,157,118,.08), var(--shadow-sm); }
.session-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.session-card-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.session-card-title h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card-title .badge { align-self: flex-start; }
.session-card-body { display: grid; gap: 6px; }
.session-card-body .info-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; text-align: left; }
.session-card-body .info-row:last-child { border-bottom: none; }
.session-card-body .info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.session-card-body .info-value { font-size: 12.5px; color: var(--ink); font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-card-body .info-value.error-text { color: var(--red); white-space: nowrap; }
.session-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.btn-action {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; font-size: 12px; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); cursor: pointer;
  transition: all .15s ease;
}
.btn-action:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
.btn-action.primary { background: var(--primary-soft); color: var(--primary); border-color: #d7e0f5; }
.btn-action.primary:hover:not(:disabled) { background: #e4ebfa; }
.btn-action.danger { color: var(--red); border-color: #f3d2d2; background: #fff; }
.btn-action.danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-action:disabled { opacity: .5; cursor: not-allowed; }
.qr-modal-body { min-height: 300px; display: grid; place-items: center; }
.qr-modal-body .placeholder { text-align: center; display: grid; gap: 6px; place-items: center; }
.qr-modal-body .qr-img { width: 260px; height: 260px; }

@media (max-width: 1400px) { .sessions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .sessions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sessions-toolbar { flex-direction: column; align-items: stretch; } .sessions-toolbar .search-input, .sessions-toolbar .filter-group { max-width: none; width: 100%; } }
@media (max-width: 640px) { .sessions-grid { grid-template-columns: 1fr; } .sessions-header { flex-direction: column; align-items: stretch; } .sessions-header .btn { width: 100%; } }
/* ==== Sessions avatar + chat full layout additions ==== */
.session-card-head { align-items: center; gap: 12px; }
.session-card-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: #e9edef; color: #54656f;
}
.session-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.session-card-avatar svg { display: block; }
.session-card-head-main { min-width: 0; flex: 1; display: grid; gap: 6px; }

.chat-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 132px); min-height: 520px; }
.chat-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chat-page-head h3 { font-size: 18px; color: var(--ink); }
.chat-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); position: relative; }
@media (max-width: 1180px) { .chat-shell { grid-template-columns: 280px minmax(0, 1fr); } .chat-info-pane { width: 280px; } }
@media (max-width: 760px) { .chat-shell { grid-template-columns: 1fr; } .chat-list-pane { max-height: 220px; } .chat-thread { min-height: 360px; } .chat-info-pane { width: 100%; } }

.chat-items { flex: 1; overflow-y: auto; min-height: 0; }
.chat-msgs { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #c6c6c6 transparent; }
.chat-msgs::-webkit-scrollbar { width: 6px; height: 6px; }
.chat-msgs::-webkit-scrollbar-thumb { background: #c6c6c6; border-radius: 3px; }
.chat-msgs::-webkit-scrollbar-track { background: transparent; }
.chat-items { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #c6c6c6 transparent; }
.chat-items::-webkit-scrollbar { width: 6px; height: 6px; }
.chat-items::-webkit-scrollbar-thumb { background: #c6c6c6; border-radius: 3px; }
.chat-items::-webkit-scrollbar-track { background: transparent; }

.chat-reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; background: #f0f2f5; border-top: 1px solid #e9edef; font-size: 12.5px; color: #54656f; }
.chat-reply-bar.hidden { display: none; }
.reply-preview { display: grid; gap: 2px; min-width: 0; flex: 1; }
.reply-label { font-weight: 600; color: #00a884; font-size: 11.5px; }
.reply-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #111b21; }

.chat-attach-preview { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #f0f2f5; border-top: 1px solid #e9edef; }
.chat-attach-preview.hidden { display: none; }
.attach-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.attach-icon { font-size: 20px; }
.attach-meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.attach-meta b { font-size: 13px; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-meta span { font-size: 11.5px; color: #667781; }
.chat-emoji-wrap { position: relative; }
.chat-emoji-picker { position: absolute; bottom: 46px; left: 0; width: 280px; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #e9edef; border-radius: 10px; box-shadow: var(--shadow); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; z-index: 20; }
.chat-emoji-picker.hidden { display: none; }
.emoji-item { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-item:hover { background: #f0f2f5; }
.chat-attach-menu { position: absolute; bottom: 42px; left: 0; background: #fff; border: 1px solid #e9edef; border-radius: 8px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 4px; z-index: 20; min-width: 140px; }
.chat-attach-menu.hidden { display: none; }
.chat-attach-menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #111b21; }
.chat-attach-menu button:hover { background: #f0f2f5; }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 16px; color: #54656f; }
.icon-btn:hover { background: #e9edef; }
.attach-btn { font-size: 22px; font-weight: 300; }

.msg-media { margin: 2px 0 6px; border-radius: 8px; overflow: hidden; }
.msg-image { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; cursor: zoom-in; }
.msg-video { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.msg-doc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(0,0,0,.05); border-radius: 6px; color: #111b21; text-decoration: none; font-size: 13px; }
.msg-doc-hint { font-size: 11px; color: #667781; }
.msg-caption { white-space: pre-wrap; margin-top: 4px; }
.msg-reply { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.08); border-radius: 50%; width: 22px; height: 22px; font-size: 12px; cursor: pointer; color: #54656f; opacity: 0; transition: opacity .15s; }
.msg-bubble:hover .msg-reply { opacity: 1; }
.msg-row.out .msg-reply { right: auto; left: 4px; }
.chat-avatar .avatar-initials { position: absolute; inset: 0; display: grid; place-items: center; }
.chat-avatar img { position: absolute; inset: 0; }
/* ==== Android preview enhancement ==== */
.android-phone { width: 300px; background: #111; border-radius: 34px; padding: 10px; box-shadow: 0 14px 36px rgba(0,0,0,.24); position: relative; }
.android-phone::before { content: ''; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 90px; height: 20px; background: #111; border-radius: 12px; z-index: 5; }
.android-screen { background: #efeae2; border-radius: 26px; overflow: hidden; min-height: 440px; display: flex; flex-direction: column; position: relative; }
.android-status { background: #075e54; color: #fff; font-size: 11px; padding: 6px 14px; display: flex; justify-content: space-between; }
.android-chat-head { background: #075e54; color: #fff; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.android-chat-head .avatar { width: 32px; height: 32px; border-radius: 50%; background: #dfe3e5; display: grid; place-items: center; color: #54656f; font-size: 12px; font-weight: 700; }
.android-chat-body { padding: 10px; display: grid; gap: 6px; flex: 1; background: #efeae2; }
.android-empty { color: #667781; font-size: 12px; text-align: center; padding: 20px; }
.wa-bubble { max-width: 82%; padding: 6px 8px 4px 9px; border-radius: 8px; font-size: 13px; line-height: 1.35; color: #111b21; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 0.5px rgba(0,0,0,.13); position: relative; background: #d9fdd3; margin-left: auto; border-top-right-radius: 0; }
.wa-bubble-text { white-space: pre-wrap; }
.wa-bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: 10px; color: #667781; }
.wa-ticks { color: #53bdeb; font-weight: 700; }
.preview-media img { max-width: 100%; border-radius: 6px; margin-bottom: 4px; display: block; }
/* ==== Responsive zoom/small viewport ==== */
.sessions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .sessions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sessions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-2 { grid-template-columns: 1fr; } .sessions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chat-shell { grid-template-columns: 300px minmax(0, 1fr); } .shell { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .sessions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chat-shell { grid-template-columns: 1fr; } .chat-list-pane { max-height: 240px; } .content { padding: 12px; } .topbar { padding: 0 12px; } .steps { flex-wrap: wrap; } .android-phone { width: 240px; } }
@media (max-width: 640px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } .sessions-grid { grid-template-columns: 1fr; } .chat-shell { grid-template-columns: 1fr; } .topbar h2 { font-size: 15px; } .card.pad { padding: 12px; } .android-phone { width: 100%; max-width: 280px; } }
img, video, table, pre, code { max-width: 100%; }
.auth-switch { margin-top: 12px; text-align: center; }
.link-btn { border:0; background:transparent; color:var(--primary); cursor:pointer; font-size:13px; font-weight:600; padding:4px; }
.link-btn:hover { text-decoration: underline; }
.check-row { display:flex; align-items:center; gap:8px; font-size:14px; color:var(--ink); }
.session-access-list { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
