/* ─── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #080815;
  --bg2:        #0E0E24;
  --bg3:        #16163A;
  --bg4:        #1E1E48;
  --border:     #2A2A58;
  --border2:    #383870;

  --gold:       #D4A832;
  --gold-l:     #F0C84A;
  --gold-d:     #A07820;
  --gold-glow:  rgba(212,168,50,0.18);
  --gold-bg:    rgba(212,168,50,0.08);

  --text:       #F0F0FF;
  --text2:      #9090C0;
  --text3:      #50507A;

  --green:  #22C55E; --green-bg:  rgba(34,197,94,.12);
  --yellow: #EAB308; --yellow-bg: rgba(234,179,8,.12);
  --red:    #EF4444; --red-bg:    rgba(239,68,68,.12);
  --blue:   #3B82F6; --blue-bg:   rgba(59,130,246,.12);
  --purple: #A855F7; --purple-bg: rgba(168,85,247,.12);
  --teal:   #14B8A6; --teal-bg:   rgba(20,184,166,.12);
  --orange: #F97316; --orange-bg: rgba(249,115,22,.12);

  --sidebar: 256px;
  --radius:  12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar);
  min-width: var(--sidebar);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width .25s ease;
}

.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* ─── Sidebar Brand ──────────────────────────────────────────────────────── */
.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-text { overflow: hidden; }
.brand-name { font-size: 13px; font-weight: 700; color: var(--gold-l); letter-spacing: .3px; white-space: nowrap; }
.brand-sub  { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav { padding: 12px 10px; flex: 1; }
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3);
  padding: 8px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text2);
  transition: all .15s; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}
.nav-item:hover  { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--gold-bg); color: var(--gold-l); border: 1px solid var(--gold-glow); }
.nav-item .icon  { font-size: 16px; width: 20px; text-align: center; }

/* ─── Sidebar Footer ─────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.setup-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg3); cursor: pointer;
  font-size: 12px; color: var(--text2);
  transition: all .15s;
}
.setup-pill:hover { color: var(--text); }
.setup-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--red);
  box-shadow: 0 0 6px currentColor;
}
.setup-dot.ok     { background: var(--green); }
.setup-dot.partial{ background: var(--yellow); }

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-head {
  padding: 24px 28px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-head p  { font-size: 13px; color: var(--text2); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

/* ─── Page Body ──────────────────────────────────────────────────────────── */
.page-body { padding: 20px 28px 32px; }
.page { display: none; }
.page.active { display: flex; flex-direction: column; flex: 1; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap; text-decoration: none;
  line-height: 1;
}
.btn-primary  { background: var(--gold); color: #0a0a15; }
.btn-primary:hover  { background: var(--gold-l); transform: translateY(-1px); box-shadow: 0 4px 16px var(--gold-glow); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--bg4); }
.btn-danger   { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card  {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-icon { font-size: 22px; width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 2px; }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ─── Grid Layouts ───────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.content-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg3); }
thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--text3); white-space: nowrap; }
tbody tr { border-top: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 10px 14px; font-size: 13px; color: var(--text2); vertical-align: middle; }
tbody td .primary { color: var(--text); font-weight: 500; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gold   { background: var(--gold-bg);   color: var(--gold-l); }
.badge-teal   { background: var(--teal-bg);   color: var(--teal); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-gray   { background: rgba(107,114,128,.15); color: #9CA3AF; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-control {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--text); font-size: 13px; width: 100%;
  transition: border-color .15s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--gold); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text3); }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs       { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn    { padding: 9px 16px; border: none; background: none; color: var(--text2); cursor: pointer; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--gold-l); border-bottom-color: var(--gold); }
.tab-panel  { display: none; }
.tab-panel.active { display: block; }

/* ─── Search Bar ─────────────────────────────────────────────────────────── */
.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-bar { position: relative; flex: 1; min-width: 200px; }
.search-bar .form-control { padding-left: 34px; }
.search-bar::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; pointer-events: none; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow); animation: slideUp .2s ease;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 20px; padding: 2px 6px; border-radius: 6px; transition: all .15s; }
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body   { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

@keyframes slideUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; min-width: 260px;
  box-shadow: var(--shadow); animation: slideUp .2s ease;
  backdrop-filter: blur(4px);
}
.toast-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: var(--green); }
.toast-error   { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.toast-info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.3); color: var(--blue); }
.toast-warn    { background: rgba(234,179,8,.15); border: 1px solid rgba(234,179,8,.3); color: var(--yellow); }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loader { display: flex; align-items: center; justify-content: center; padding: 32px; }
.spin { width: 24px; height: 24px; border: 2px solid var(--border2); border-top-color: var(--gold); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.campaign-type-icon { font-size: 20px; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

/* ─── Offer Cards ────────────────────────────────────────────────────────── */
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.offer-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.offer-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.offer-img {
  width: 100%; height: 150px; object-fit: cover;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.offer-body { padding: 14px; }
.offer-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.offer-dest  { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.offer-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.offer-tag   { font-size: 10px; background: var(--bg3); color: var(--text2); padding: 2px 6px; border-radius: 4px; }
.offer-foot  { display: flex; gap: 6px; }

/* ─── Campaign Type Cards (create) ──────────────────────────────────────── */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.type-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 8px;
  text-align: center; cursor: pointer; transition: all .15s;
}
.type-card:hover { border-color: var(--border2); }
.type-card.selected { border-color: var(--gold); background: var(--gold-bg); }
.type-card .t-icon { font-size: 22px; margin-bottom: 4px; }
.type-card .t-name { font-size: 11px; font-weight: 600; color: var(--text2); }
.type-card.selected .t-name { color: var(--gold-l); }

/* ─── RCS Builder ────────────────────────────────────────────────────────── */
.builder-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.builder-form { display: flex; flex-direction: column; gap: 14px; }
.card-editor  { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-top: 8px; }
.card-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.action-row  { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }

/* Phone Preview */
.phone-wrap { position: sticky; top: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phone-frame {
  width: 300px;
  background: #1C1C3A;
  border-radius: 36px;
  padding: 16px 12px;
  border: 2px solid var(--border2);
  box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0,0,0,.6);
}
.phone-notch {
  width: 60px; height: 4px; background: var(--border2); border-radius: 2px;
  margin: 0 auto 12px;
}
.phone-screen {
  background: #EBEBEB; border-radius: 24px; overflow: hidden;
  min-height: 460px; display: flex; flex-direction: column;
}
.phone-header {
  background: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #ddd; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.phone-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #0a0a15; flex-shrink: 0;
}
.phone-sender-name { font-size: 13px; font-weight: 600; color: #111; }
.phone-msgs { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.chat-bubble {
  background: #fff; border-radius: 14px 14px 14px 4px;
  padding: 8px 12px; font-size: 12px; color: #333;
  max-width: 240px; box-shadow: 0 1px 3px rgba(0,0,0,.1);
  line-height: 1.4;
}
.rcs-preview-card {
  background: #fff; border-radius: 14px; overflow: hidden;
  max-width: 240px; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.rcs-preview-img {
  width: 100%; height: 110px; background: linear-gradient(135deg,#667eea,#764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; position: relative; overflow: hidden;
}
.rcs-preview-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.rcs-preview-content { padding: 10px; }
.rcs-preview-title { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 3px; }
.rcs-preview-body  { font-size: 11px; color: #555; line-height: 1.4; }
.rcs-preview-actions { border-top: 1px solid #eee; }
.rcs-action {
  padding: 9px 10px; text-align: center; font-size: 12px; font-weight: 600;
  border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.rcs-action:last-child { border-bottom: none; }
.rcs-action.url    { color: #1a73e8; }
.rcs-action.call   { color: #34a853; }
.rcs-action.reply  { color: #ea4335; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.quick-reply-btn {
  background: none; border: 1.5px solid #ccc;
  border-radius: 99px; padding: 5px 12px;
  font-size: 11px; color: #1a73e8; cursor: pointer;
}
/* Carousel preview */
.rcs-carousel-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.rcs-carousel-scroll .rcs-preview-card { min-width: 200px; }

/* ─── Setup ──────────────────────────────────────────────────────────────── */
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.setup-step {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
}
.setup-step-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text2);
}
.setup-step.done .setup-step-num { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.setup-step-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.setup-step-desc  { font-size: 12px; color: var(--text2); line-height: 1.5; }
.setup-check { font-size: 22px; }

/* ─── Analytics ──────────────────────────────────────────────────────────── */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { width: 120px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--gold); border-radius: 4px; transition: width .5s ease; }
.bar-val   { width: 40px; text-align: right; color: var(--text); font-weight: 600; }

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.text-muted  { color: var(--text3); }
.text-gold   { color: var(--gold-l); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.w-full      { width: 100%; }
.font-bold   { font-weight: 700; }
.font-sm     { font-size: 12px; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: monospace; color: var(--gold-l); }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }

/* ─── Settings Page ──────────────────────────────────────────────────────── */
.setup-info-bar {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
}
.setup-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  line-height: 1.5;
}
.setup-step-num-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  margin-right: 6px;
  flex-shrink: 0;
  transition: background 0.3s;
}

.nav-badge { background:var(--red); color:#fff; border-radius:10px; padding:1px 7px; font-size:10px; font-weight:700; margin-left:auto; }

/* ─── Inbox / Conversations ──────────────────────────────────────────────── */
.inbox-layout { display:grid; grid-template-columns:320px 1fr; height:calc(100vh - 60px); overflow:hidden; }
.inbox-sidebar { border-right:1px solid var(--border); overflow-y:auto; display:flex; flex-direction:column; }
.inbox-search { padding:12px; border-bottom:1px solid var(--border); }
.inbox-conv-item { padding:14px 16px; border-bottom:1px solid var(--border); cursor:pointer; transition:background 0.15s; display:flex; gap:12px; align-items:flex-start; }
.inbox-conv-item:hover, .inbox-conv-item.active { background:var(--bg3); }
.inbox-conv-item.unread { border-left:3px solid var(--gold); }
.inbox-avatar { width:40px; height:40px; border-radius:50%; background:var(--gold-bg); border:1px solid var(--gold); display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--gold); font-size:15px; flex-shrink:0; }
.inbox-conv-meta { flex:1; min-width:0; }
.inbox-conv-name { font-size:13px; font-weight:600; color:var(--text); }
.inbox-conv-preview { font-size:11px; color:var(--text2); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inbox-conv-time { font-size:10px; color:var(--text3); white-space:nowrap; }
.inbox-thread-wrap { display:flex; flex-direction:column; overflow:hidden; }
.inbox-thread-header { padding:14px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:14px; background:var(--bg2); flex-shrink:0; }
.inbox-thread-messages { flex:1; overflow-y:auto; padding:20px; display:flex; flex-direction:column; gap:10px; }
.inbox-msg { max-width:70%; display:flex; flex-direction:column; }
.inbox-msg.in { align-self:flex-start; }
.inbox-msg.out { align-self:flex-end; }
.inbox-msg-bubble { padding:10px 14px; border-radius:16px; font-size:13px; line-height:1.5; }
.inbox-msg.in .inbox-msg-bubble { background:var(--bg3); border:1px solid var(--border); color:var(--text); border-bottom-left-radius:4px; }
.inbox-msg.out .inbox-msg-bubble { background:var(--gold); color:#000; font-weight:500; border-bottom-right-radius:4px; }
.inbox-msg.out.rcs .inbox-msg-bubble { background:linear-gradient(135deg,#1E1E48,#2A2A70); border:1px solid var(--gold); color:var(--text); }
.inbox-msg-meta { font-size:10px; color:var(--text3); margin-top:3px; padding:0 4px; }
.inbox-msg.out .inbox-msg-meta { text-align:right; }
.inbox-composer { border-top:1px solid var(--border); padding:14px 20px; background:var(--bg2); flex-shrink:0; }
.inbox-composer-tabs { display:flex; gap:6px; margin-bottom:10px; }
.inbox-composer-tab { padding:5px 12px; border-radius:20px; font-size:12px; font-weight:600; cursor:pointer; border:1px solid var(--border); color:var(--text2); background:var(--bg3); transition:all 0.15s; }
.inbox-composer-tab.active { background:var(--gold); color:#000; border-color:var(--gold); }
.inbox-empty-state { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--text2); font-size:14px; }
.product-rcs-card { border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--bg3); }
.product-rcs-card img { width:100%; height:160px; object-fit:cover; }
.product-rcs-card-body { padding:12px; }
.product-rcs-card-title { font-size:14px; font-weight:700; margin-bottom:4px; }
.product-rcs-card-desc { font-size:12px; color:var(--text2); }
.product-rcs-card-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
/* ─── Auto Replies ───────────────────────────────────────────────────────── */
.ar-rule-card { background:var(--bg2); border:1px solid var(--border); border-radius:12px; padding:16px 20px; margin-bottom:10px; display:grid; grid-template-columns:1fr auto; gap:12px; align-items:start; }
.ar-rule-card.inactive { opacity:0.55; border-style:dashed; }
.ar-trigger-pill { display:inline-flex; align-items:center; gap:5px; background:var(--bg3); border:1px solid var(--border); border-radius:20px; padding:3px 10px; font-size:11px; color:var(--text2); margin-top:4px; }

/* ─── Test RCS Page ──────────────────────────────────────────────────────── */

/* Layout: 2-col (form + phone preview) */
.test-main-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}
.test-form-card { min-height: 500px; }
.test-preview-col { min-width: 0; }

/* Message type tabs */
.test-type-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.test-type-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.test-type-tab:hover { border-color: var(--gold); color: var(--gold); }
.test-type-tab.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* Panels */
.test-panel { display: none; margin-top: 14px; }
.test-panel.active { display: block; }

/* Carousel offer checkboxes */
.test-carousel-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.test-carousel-check-row:hover { border-color: var(--gold); }
.test-carousel-check-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* ── Phone Frame ── */
.test-phone-frame {
  width: 280px;
  background: #0f0f0f;
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #333,
    0 0 0 4px #1a1a1a,
    0 30px 60px rgba(0,0,0,0.5);
  position: relative;
}
.test-phone-frame::before {
  content: '';
  display: block;
  width: 80px;
  height: 6px;
  background: #222;
  border-radius: 3px;
  margin: 0 auto 10px;
}
.test-phone-screen {
  background: #1a1a2e;
  border-radius: 34px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.test-phone-header {
  background: #16213e;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.test-phone-sender {
  display: flex;
  align-items: center;
  gap: 10px;
}
.test-phone-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8B6914);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #000;
  flex-shrink: 0;
}
.test-phone-name { font-size: 12px; font-weight: 700; color: #fff; }
.test-phone-sub  { font-size: 10px; color: #1a73e8; margin-top: 1px; }
.test-phone-messages {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 380px;
}
.test-phone-home-bar {
  width: 80px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin: 8px auto 4px;
}

/* SMS bubble */
.test-phone-bubble-sms {
  background: #2d2d4e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 12px;
  max-width: 90%;
}
.test-phone-bubble-sms p {
  font-size: 12px;
  color: #e8e8e8;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Quick reply buttons (in phone) */
.test-phone-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 0;
}
.test-phone-qr-btn {
  padding: 6px 12px;
  border: 1px solid #1a73e8;
  border-radius: 20px;
  font-size: 11px;
  color: #1a73e8;
  background: rgba(26,115,232,0.12);
  cursor: default;
  white-space: nowrap;
}

/* Carousel wrapper */
.test-phone-carousel {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.test-phone-carousel::-webkit-scrollbar { height: 3px; }
.test-phone-carousel::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* RCS Card in phone preview */
.test-phone-card {
  background: #1e2240;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
  max-width: 240px;
}
.test-phone-card.compact { min-width: 160px; max-width: 180px; }
.test-card-img-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  overflow: hidden;
  background: #0f0f1e;
}
.test-phone-card.compact .test-card-img-wrap { height: 80px; }
.test-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.test-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.test-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--gold);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  z-index: 1;
}
.test-card-body { padding: 10px; }
.test-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
}
.test-phone-card.compact .test-card-title { font-size: 11px; }
.test-card-dest { font-size: 10px; color: #8ab4f8; margin-bottom: 3px; }
.test-card-desc { font-size: 10px; color: #aaa; line-height: 1.4; margin-bottom: 4px; }
.test-card-price { font-size: 10px; color: var(--gold-l); font-weight: 600; margin-bottom: 5px; }
.test-card-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.test-card-btn {
  padding: 5px 9px;
  border: 1px solid #1a73e8;
  border-radius: 20px;
  font-size: 10px;
  color: #1a73e8;
  background: rgba(26,115,232,0.12);
  cursor: default;
  white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .builder-layout { grid-template-columns: 1fr; }
  .phone-wrap { position: static; }
  .test-main-grid { grid-template-columns: 1fr; }
  .test-preview-col { order: -1; }
}
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { width: 0; min-width: 0; overflow: hidden; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .type-grid  { grid-template-columns: repeat(2,1fr); }
  .page-head  { padding: 16px 16px 0; }
  .page-body  { padding: 14px 16px 24px; }
}
