﻿:root {
  --bg-0: #eceae3;
  --bg-1: #f7f4ee;
  --card: rgba(255, 252, 246, 0.84);
  --ink: #0f2238;
  --muted: #596879;
  --line: #d8c9ad;
  --brand: #0f8f45;
  --brand-2: #25d366;
  --danger: #cf4a4a;
  --shadow: 0 18px 48px rgba(18, 34, 52, 0.14);
  --panel-shell:
    radial-gradient(circle at 12% 16%, rgba(55, 188, 111, 0.1), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(84, 117, 179, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(245, 240, 231, 0.94));
  --panel-shell-border: color-mix(in srgb, var(--line) 78%, transparent);
  --panel-shell-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 18px 34px rgba(18, 34, 52, 0.1);
  --panel-chip-bg: rgba(255, 249, 241, 0.82);
  --panel-chip-border: rgba(155, 135, 105, 0.18);
  --panel-card-bg: rgba(255, 251, 244, 0.8);
  --panel-card-border: rgba(155, 135, 105, 0.2);
  --panel-wordmark: #213349;
  --panel-title: #11253a;
  --panel-subtitle: #627488;
  --panel-meter-bg: rgba(191, 181, 161, 0.6);
  --panel-toggle-bg: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(238, 231, 220, 0.96));
  --panel-toggle-border: rgba(155, 135, 105, 0.2);
  --panel-badge-bg: linear-gradient(180deg, rgba(88, 146, 74, 0.95), rgba(69, 121, 58, 0.95));
  --panel-badge-ink: #efffde;
  --panel-logout-bg: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(238, 231, 220, 0.96));
  --panel-logout-ink: #213349;
}

body.dark {
  --bg-0: #0a1623;
  --bg-1: #0f2031;
  --card: rgba(17, 34, 52, 0.84);
  --ink: #e9f3ff;
  --muted: #95a8bc;
  --line: #29425a;
  --brand: #1aa157;
  --brand-2: #39df7a;
  --danger: #d96565;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.35);
  --panel-shell:
    radial-gradient(circle at 12% 16%, rgba(55, 188, 111, 0.14), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(84, 117, 179, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(18, 32, 49, 0.96), rgba(15, 27, 42, 0.94));
  --panel-shell-border: color-mix(in srgb, var(--line) 78%, transparent);
  --panel-shell-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 34px rgba(4, 11, 20, 0.28);
  --panel-chip-bg: rgba(15, 27, 42, 0.74);
  --panel-chip-border: rgba(110, 130, 165, 0.2);
  --panel-card-bg: rgba(15, 27, 42, 0.78);
  --panel-card-border: rgba(110, 130, 165, 0.18);
  --panel-wordmark: #f3f6fb;
  --panel-title: #f7fbff;
  --panel-subtitle: #b4c0d2;
  --panel-meter-bg: rgba(61, 77, 101, 0.72);
  --panel-toggle-bg: linear-gradient(180deg, rgba(25, 38, 56, 0.94), rgba(17, 27, 41, 0.94));
  --panel-toggle-border: rgba(117, 136, 171, 0.18);
  --panel-badge-bg: linear-gradient(180deg, rgba(50, 108, 61, 0.95), rgba(41, 85, 51, 0.95));
  --panel-badge-ink: #dfffc9;
  --panel-logout-bg: linear-gradient(180deg, rgba(31, 44, 63, 0.95), rgba(21, 31, 45, 0.95));
  --panel-logout-ink: #eef4ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(1200px 650px at -8% -12%, rgba(30, 142, 78, 0.26), transparent 65%),
    radial-gradient(1200px 650px at 115% 0%, rgba(62, 206, 121, 0.2), transparent 68%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1));
  animation: pageIn 0.45s ease;
}

.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.2rem auto 1.8rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, #54d487 55%, var(--line) 45%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 211, 102, 0.18), transparent 40%),
    linear-gradient(135deg, color-mix(in srgb, var(--card) 88%, transparent), color-mix(in srgb, #dbffe9 30%, var(--card) 70%));
  box-shadow: 0 14px 30px rgba(18, 34, 52, 0.12);
}

.install-copy {
  min-width: 0;
}

.install-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.install-copy p {
  margin: 0.3rem 0 0;
}

.install-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex: 0 0 auto;
}

.install-actions button {
  width: auto;
  margin-top: 0;
}

.install-btn {
  min-width: 148px;
}

.ghost-btn {
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border: 1px solid var(--line);
  box-shadow: none;
}

.ghost-btn:hover {
  box-shadow: none;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 54px rgba(18, 34, 52, 0.18);
}

.card.inner {
  margin-top: 0.8rem;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

h3 {
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
}

h4 {
  margin-bottom: 0.8rem;
  font-size: 1.07rem;
}

p,
small,
label {
  margin-top: 0.5rem;
  display: block;
}

small,
p {
  color: var(--muted);
}

input,
textarea,
select,
button {
  border-radius: 12px;
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
  padding: 0.74rem 0.8rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.dark input,
body.dark textarea,
body.dark select {
  background: rgba(9, 20, 32, 0.45);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--ink);
  box-shadow: none;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
}

.password-toggle-btn:hover {
  transform: translateY(-50%);
  filter: none;
  box-shadow: none;
}

button {
  width: 100%;
  border: 0;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  padding: 0.72rem 0.95rem;
  cursor: pointer;
  margin-top: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 10px 26px rgba(35, 104, 225, 0.32);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.danger {
  width: auto;
  margin-top: 0;
  background: linear-gradient(120deg, #b14040, var(--danger));
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.top-brand {
  display: flex;
  flex-direction: column;
  padding: 0.65rem;
  border: 1px solid var(--panel-shell-border);
  border-radius: 18px;
  background: var(--panel-shell);
  box-shadow: var(--panel-shell-shadow);
}

.brand-head {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-start;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(118, 241, 142, 0.22);
  box-shadow: 0 16px 28px rgba(7, 19, 32, 0.36);
  background: #09141f;
  flex: 0 0 auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 88px;
  padding-top: 0.1rem;
  min-width: 0;
}

.brand-wordmark {
  margin-bottom: 0.46rem;
  font-family: "Orbitron", "Arial Black", "Sora", "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--panel-wordmark);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-user {
  display: block;
  margin-top: 0;
  font-size: clamp(1.42rem, 2.1vw, 1.8rem);
  font-weight: 800;
  color: var(--panel-title);
  line-height: 1.06;
  letter-spacing: 0.01em;
}

.brand-email {
  margin-top: 0.34rem;
  font-size: 0.99rem;
  font-weight: 500;
  color: var(--panel-subtitle);
  line-height: 1.25;
  word-break: break-word;
}

#waProfile {
  display: none;
  margin-top: 0.58rem;
  font-size: 0.86rem;
  line-height: 1.35;
}

.right-buttons {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.3rem;
  border: 1px solid var(--panel-chip-border);
  border-radius: 14px;
  background: var(--panel-chip-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-switch {
  width: 48px;
  padding: 0;
  margin-top: 0;
  background: transparent;
  box-shadow: none;
}

.theme-switch:hover {
  box-shadow: none;
}

.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--panel-toggle-border);
  background: var(--panel-toggle-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

body.dark .theme-switch-track {
  background: var(--panel-toggle-bg);
}

.theme-switch-icon {
  position: relative;
  font-size: 1rem;
  color: var(--panel-title);
}

.theme-switch-icon-light {
  display: none;
}

.theme-switch-thumb {
  display: none;
}

body.dark .theme-switch-thumb {
  transform: none;
}

.power-btn {
  width: auto;
  min-width: 72px;
  height: 34px;
  padding: 0 1rem;
  margin-top: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-logout-ink);
  background: var(--panel-logout-bg);
  border: 1px solid var(--panel-toggle-border);
  box-shadow: none;
}

.power-btn-label {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: stretch;
  width: 100%;
  margin-top: 0.85rem;
}

.membership-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.42rem 0.5rem 0.42rem 0.72rem;
  border: 1px solid var(--panel-card-border);
  border-radius: 14px;
  background: var(--panel-card-bg);
}

.membership-strip-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-subtitle);
  font-size: 0.95rem;
  background: var(--panel-chip-bg);
  border: 1px solid var(--panel-chip-border);
}

.membership-strip-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.membership-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.45rem 0.9rem;
  border-radius: 11px;
  background: var(--panel-badge-bg);
  color: var(--panel-badge-ink);
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(128, 225, 110, 0.14);
}

.usage-card {
  min-width: 220px;
  padding: 0.78rem 0.88rem 0.86rem;
  border: 1px solid var(--panel-card-border);
  border-radius: 14px;
  background: var(--panel-card-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.usage-card-admin {
  min-width: 0;
  flex: 1 1 340px;
}

.usage-card-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--panel-subtitle);
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.usage-card-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #9fe46e;
  font-size: 1rem;
  line-height: 1;
}

.usage-card strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.8rem;
  line-height: 1.1;
  color: var(--panel-title);
}

.usage-meter {
  height: 9px;
  margin-top: 0.72rem;
  border-radius: 999px;
  background: var(--panel-meter-bg);
  overflow: hidden;
}

.usage-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #8fe66b);
  transition: width 0.25s ease;
}

.usage-card-lines .usage-meter span {
  background: linear-gradient(90deg, #9fe46e, #c8ff6a);
}

.usage-meter span.infinite {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0.5rem;
}

.module-tab {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 0.78rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--ink);
}

.module-tab.active {
  border-color: color-mix(in srgb, var(--brand) 62%, #ffffff 38%);
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 9px 24px rgba(38, 113, 232, 0.26);
}

.wa-led {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 0.15rem;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  vertical-align: middle;
}

.wa-led.on {
  background: #25d366;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.26), 0 0 12px rgba(37, 211, 102, 0.65);
}

.wa-led.off {
  background: #e05a5a;
  box-shadow: 0 0 0 2px rgba(224, 90, 90, 0.22), 0 0 10px rgba(224, 90, 90, 0.6);
}

.module {
  animation: fadeUp 0.25s ease;
}

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

.stage-pills {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stage-pill {
  padding: 0.35rem 0.74rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.stage-pill.done {
  border-color: color-mix(in srgb, var(--brand) 55%, #ffffff 45%);
  color: color-mix(in srgb, var(--brand) 65%, #ffffff 35%);
}

.stage-pill.active {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
}

.stage-pills button.stage-pill {
  width: auto;
  margin-top: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--muted);
  box-shadow: none;
}

.stage-pills button.stage-pill:hover {
  transform: none;
  filter: none;
  border-color: color-mix(in srgb, var(--brand) 58%, #ffffff 42%);
  box-shadow: 0 8px 20px rgba(35, 104, 225, 0.18);
}

.stage-pills button.stage-pill.active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
}

.wizard-stage {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: color-mix(in srgb, var(--card) 85%, transparent);
}

.ab-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.ab-wrapper.enabled {
  grid-template-columns: 1fr 1fr;
}

.ab-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
  background: color-mix(in srgb, var(--card) 82%, transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.grid-span-2 {
  grid-column: span 2;
}

.channel-routing-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.65rem;
}

.mode-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.mode-panel section + section {
  margin-top: 0.75rem;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

.delay-rule-title {
  min-width: 320px;
  font-size: 0.93rem;
  color: var(--ink);
  margin-right: 0.35rem;
}

.inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.channel-activator {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.channel-toggle {
  width: auto;
  margin-top: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: #d8dde7;
  color: #243449;
}

.channel-toggle.active {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
}

.channel-toggle.inactive {
  background: #d8dde7;
  color: #243449;
}

#activeFlowButtons .channel-toggle {
  background: #d8dde7;
  color: #243449;
  border: 1px solid #b8c2d1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#activeFlowButtons .channel-toggle.active {
  background: #d8dde7;
  color: #243449;
  border: 1px solid var(--brand);
}

.line-led {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #8b96a8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.line-led.on {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.channel-init-btn {
  width: auto;
  margin-top: 0;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.channel-init-btn .line-led {
  width: 8px;
  height: 8px;
}

.delay-box {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.wa-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  margin-top: 0.8rem;
  background: color-mix(in srgb, var(--card) 80%, transparent);
}

.wa-block h4 {
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.delay-box h3 {
  margin-bottom: 0.42rem;
}

.delay-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.62rem;
}

.delay-row + .delay-row {
  margin-top: 0.24rem;
}

.delay-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.delay-row input[type="number"] {
  width: 88px;
}

.country-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.65rem;
}

.country-row > * {
  flex: 1;
}

.country-row button {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
}

.qr {
  width: min(320px, 100%);
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.3rem;
}

.msg {
  min-height: 1.3rem;
  margin-top: 0.65rem;
  font-weight: 500;
}

.template-var-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.template-var-btn {
  width: auto;
  margin-top: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 82%, #4f8ff7 18%);
  color: var(--ink);
  font-size: 0.85rem;
}

.template-var-btn:hover {
  filter: brightness(1.08);
}

.verify-btn {
  background: linear-gradient(120deg, #2b85ff, #5ea4ff);
  color: #fff;
}

.warning-btn {
  background: linear-gradient(120deg, #f2b705, #f7d154);
  color: #243047;
}

.google-import-btn {
  background: linear-gradient(120deg, #d93f3f, #f05a5a);
  color: #fff;
}

.icloud-import-btn {
  background: linear-gradient(120deg, #f2b705, #f7d154);
  color: #243047;
}

.msg-success {
  color: #22c55e;
}

.profile-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.profile-info strong {
  color: var(--ink);
}

.line-test-summary {
  margin: 0.65rem 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.3;
}

.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 0.28rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #2b85ff, #00b5c9);
  cursor: help;
  position: relative;
  vertical-align: middle;
  user-select: none;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(320px, 75vw);
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: #eff7ff;
  background: #0f253b;
  border: 1px solid #2d4c69;
  box-shadow: 0 14px 30px rgba(5, 20, 35, 0.35);
  font-size: 0.8rem;
  line-height: 1.28;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

ul {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: color-mix(in srgb, var(--card) 78%, transparent);
}

.campaign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.inline-btn {
  width: auto;
  margin-top: 0;
  padding: 0.45rem 0.8rem;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 20, 32, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.modal-card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.modal-wide {
  width: min(980px, 100%);
}

.grow {
  flex: 1 1 auto;
}

.inline-label {
  margin: 0;
  min-width: 12rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.modal-actions .inline-btn {
  flex: 1;
}

.import-toolbar {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 0.5rem;
}

.import-toolbar > * {
  min-width: 0;
}

.import-toolbar > .inline-label {
  flex: 0 0 170px;
  min-width: 170px;
  padding-top: 0.35rem;
}

.import-toolbar .help-tip {
  flex: 0 0 auto;
  margin-top: 0.25rem;
  margin-left: 0;
}

.import-toolbar .inline-btn {
  flex: 0 0 auto;
  white-space: normal;
  word-break: break-word;
}

.import-toolbar-top #importCountryCode {
  flex: 1 1 210px;
  min-width: 200px;
}

.import-toolbar-actions {
  margin-top: 0.25rem;
}

.import-toolbar-actions .inline-btn {
  flex: 1 1 260px;
}

#savedContactListInfo {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

#contactListRaw {
  min-height: 220px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.sheet-wrap {
  margin-top: 0.55rem;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sheet-table {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  min-width: 760px;
}

.sheet-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.sheet-table td {
  padding: 0.25rem;
}

.wa-check-cell {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
}

.wa-check-cell.ok {
  color: #22c55e;
}

.wa-check-cell.no {
  color: #ef4444;
}

.wa-check-cell.pending {
  color: #94a3b8;
}

.sheet-cell {
  width: 100%;
  min-width: 100px;
  padding: 0.4rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.sheet-cell:focus {
  outline: none;
  border-color: #4f8ff7;
  background: color-mix(in srgb, var(--card) 90%, #4f8ff7 10%);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 0.75rem;
}

.table-scroll table {
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.admin-stats-scroll {
  max-height: 62vh;
}

.admin-stats-table {
  min-width: 1350px;
}

.admin-stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--brand) 26%, var(--card) 74%);
  box-shadow: inset 0 -1px 0 var(--line);
}

th,
td {
  text-align: left;
  padding: 0.56rem 0.58rem;
  border-bottom: 1px solid var(--line);
}

th {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
}

tr:last-child td {
  border-bottom: 0;
}

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

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .ab-wrapper.enabled {
    grid-template-columns: 1fr;
  }

  .delay-rule-title {
    min-width: 100%;
    margin-bottom: 0.2rem;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 1rem);
    margin-top: 0.55rem;
  }

  .card {
    border-radius: 14px;
    padding: 0.85rem;
  }

  .top,
  .country-row,
  .right-buttons,
  .install-banner,
  .install-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .top-brand {
    padding: 0.68rem;
    gap: 0.75rem;
  }

  .brand-block {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: center;
    gap: 0.78rem;
  }

  .brand-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.78rem;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .brand-copy {
    min-height: 60px;
    padding: 0.05rem 0 0.05rem 0;
  }

  .brand-wordmark {
    margin-bottom: 0.26rem;
    font-size: 0.86rem;
    letter-spacing: 0.1em;
  }

  .brand-user {
    font-size: 1.34rem;
    line-height: 1.08;
  }

  .brand-email {
    margin-top: 0.22rem;
    font-size: 0.95rem;
  }

  #waProfile {
    display: none;
  }

  .usage-summary {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0.62rem;
  }

  .usage-card {
    min-width: 0;
    padding: 0.78rem 0.8rem;
    border-radius: 14px;
  }

  .membership-strip {
    padding: 0.42rem 0.5rem 0.42rem 0.58rem;
    gap: 0.62rem;
  }

  .membership-strip-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .membership-badge {
    min-height: 32px;
    padding: 0.42rem 0.78rem;
    font-size: 0.94rem;
  }

  .usage-card-admin {
    flex: 0 0 auto;
  }

  .usage-card strong {
    font-size: 1.62rem;
  }

  .usage-card-title {
    gap: 0.45rem;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
  }

  .usage-card-title-icon {
    width: 18px;
    height: 18px;
    font-size: 0.92rem;
  }

  .right-buttons {
    width: fit-content;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
    margin-top: 0;
  }

  .theme-switch {
    width: 46px;
  }

  .theme-switch-track {
    width: 46px;
    height: 34px;
  }

  .theme-switch-icon {
    font-size: 1rem;
  }

  .power-btn {
    min-width: 68px;
    height: 34px;
  }

  .power-btn-label {
    font-size: 0.95rem;
  }

  .module-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.45rem;
    padding-bottom: 0.15rem;
    margin-top: 0.7rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar,
  .stage-pills::-webkit-scrollbar {
    display: none;
  }

  .module-tab,
  .country-row button,
  .install-actions button {
    width: 100%;
  }

  .module-tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 46px;
    white-space: nowrap;
    padding: 0.62rem 0.9rem;
  }

  .module.card.inner {
    padding: 0.78rem;
  }

  .module h3 {
    font-size: 1.28rem;
    line-height: 1.12;
  }

  .stage-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .stage-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .wizard-stage {
    padding: 0.85rem;
  }

  .wizard-stage h4,
  .delay-box h3,
  .wa-block h4 {
    font-size: 1.06rem;
    line-height: 1.18;
  }

  .country-row {
    gap: 0.55rem;
  }

  .delay-box,
  .mode-panel,
  .wizard-stage,
  .ab-card {
    border-radius: 16px;
  }

  textarea {
    min-height: 132px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
    padding: 0.78rem 0.82rem;
  }

  .country-row > * {
    min-width: 0;
  }

  .country-row button,
  .inline-btn,
  #saveCampaignBtn,
  #scheduleCampaignBtn,
  #runSelectedNowBtn,
  #goScheduleSelectedBtn,
  #goStage2Btn,
  #goStage3Btn,
  #goStage4Btn,
  #backStage1Btn,
  #backStage2Btn,
  #openCreateListBtn,
  #openEditListBtn,
  #applyCountryBtn {
    min-height: 48px;
    border-radius: 14px;
  }

  .delay-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0.5rem;
  }

  .delay-rule-title {
    min-width: 0;
    grid-column: 1 / -1;
    margin-right: 0;
    margin-bottom: 0.1rem;
    font-size: 0.95rem;
  }

  .delay-row span {
    font-size: 0.88rem;
    line-height: 1.32;
  }

  .delay-row input[type="number"] {
    width: 100%;
  }

  .template-var-bar {
    gap: 0.35rem;
  }

  .template-var-btn {
    padding: 0.38rem 0.62rem;
    font-size: 0.8rem;
  }

  .channel-activator {
    gap: 0.55rem;
  }

  .channel-toggle,
  .channel-init-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .wa-block {
    padding: 0.78rem;
  }

  .qr {
    width: min(280px, 100%);
    margin-inline: auto;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    overflow: auto;
    padding: 0.95rem 0.9rem 1rem;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
    background: rgba(6, 14, 23, 0.78);
  }

  .modal-wide {
    width: 100%;
    max-width: 100%;
  }

  .modal-card h3,
  #contactListModalTitle {
    font-size: 1.16rem;
    line-height: 1.15;
  }

  .import-toolbar > .inline-label {
    flex: 1 1 100%;
    min-width: 0;
    padding-top: 0;
  }

  .import-toolbar,
  .import-toolbar-top,
  .import-toolbar-actions {
    gap: 0.55rem;
  }

  .import-toolbar > * {
    min-width: 0;
  }

  .import-toolbar .help-tip {
    margin-top: 0.1rem;
  }

  .import-toolbar .inline-btn,
  .import-toolbar-top #importCountryCode,
  #verifyWhatsappBtn,
  #removeNoWhatsappBtn,
  #importGoogleContactsBtn,
  #importIcloudContactsBtn,
  #importClearBtn,
  #importApplyBtn,
  #importCancelBtn {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.55rem;
  }

  .modal-actions button {
    min-height: 48px;
    border-radius: 14px;
  }

  #importSheetBody td,
  #importSheetBody th,
  th,
  td {
    padding: 0.52rem 0.46rem;
  }

  .users-table {
    border: 0;
  }

  .users-table thead {
    display: none;
  }

  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 0.65rem;
    padding: 0.45rem 0.6rem;
    background: color-mix(in srgb, var(--card) 78%, transparent);
  }

  .users-table td {
    border-bottom: 1px dashed var(--line);
    padding: 0.5rem 0.2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    white-space: normal;
    word-break: break-word;
  }

  .users-table td:last-child {
    border-bottom: 0;
  }

  .users-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
    min-width: 5rem;
  }

  .users-table .user-actions {
    justify-content: flex-end;
  }

  .users-table .user-actions .inline-btn {
    padding: 0.42rem 0.62rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  .top-brand {
    padding: 0.62rem;
  }

  .brand-block {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.68rem;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .brand-wordmark {
    font-size: 0.8rem;
    letter-spacing: 0.09em;
  }

  .brand-user {
    font-size: 1.22rem;
  }

  .brand-email {
    font-size: 0.9rem;
  }

  .right-buttons-compact {
    margin-left: 0;
  }

  .brand-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
  }
}
