
:root {
  --bg: #030711;
  --bg2: #07101f;
  --card: rgba(10, 18, 33, .86);
  --card2: rgba(14, 24, 42, .72);
  --stroke: rgba(71, 128, 255, .18);
  --text: #f5f8ff;
  --muted: #9fb0d8;
  --blue: #2e7cff;
  --blue2: #0f61ff;
  --green: #2dd584;
  --yellow: #ffbd3d;
  --red: #ff5d73;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .45), 0 0 30px rgba(17, 99, 255, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(46,124,255,.18), transparent 26%),
    radial-gradient(circle at 84% 8%, rgba(0,98,255,.16), transparent 28%),
    linear-gradient(180deg, #02050c 0%, #06101d 42%, #030711 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(255,255,255,.7), transparent 85%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.container { width: min(1220px, calc(100% - 36px)); margin: 0 auto; }
.glow, .card, .metric, .panel, .auth-card, .table-card, .modal-card {
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.soft { background: var(--card2); border: 1px solid rgba(255,255,255,.07); border-radius: 16px; }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(3, 7, 17, .64);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .06em; }
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; }
.brand.small img { width: 36px; height: 36px; }
.nav { display: flex; align-items: center; gap: 26px; color: #d5e0ff; }
.nav a:hover { color: white; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 18px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue2)); box-shadow: 0 14px 34px rgba(17,99,255,.35); }
.btn-secondary { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.12); }
.btn-ghost { background: transparent; color: #d9e5ff; }
.btn-danger { background: rgba(255,93,115,.14); color: #ffd5db; border: 1px solid rgba(255,93,115,.22); }
.btn-small { padding: 9px 12px; font-size: .88rem; }
.btn-full { width: 100%; }
.badge, .pill, .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: .78rem;
  font-weight: 800;
  color: #a9caff;
  background: rgba(46,124,255,.10);
  border: 1px solid rgba(46,124,255,.20);
  text-transform: uppercase;
  letter-spacing: .045em;
}
.status.active, .tag.green { color: #c7ffdf; background: rgba(45,213,132,.14); border-color: rgba(45,213,132,.18); }
.status.pending, .tag.yellow { color: #ffebb9; background: rgba(255,189,61,.14); border-color: rgba(255,189,61,.2); }
.status.suspended, .tag.red { color: #ffd5db; background: rgba(255,93,115,.14); border-color: rgba(255,93,115,.2); }
.tag.blue { color: #d7e7ff; background: rgba(46,124,255,.16); border-color: rgba(46,124,255,.18); }
.tag.gray { color: #dce4f7; background: rgba(159,176,216,.12); border-color: rgba(159,176,216,.16); }

.hero { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; padding: 68px 0; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.6rem); line-height: .94; letter-spacing: -.065em; margin: 18px 0; }
.hero h1 span, .blue-text { color: var(--blue); }
.hero p, .muted { color: var(--muted); line-height: 1.7; }
.hero p { font-size: 1.18rem; max-width: 620px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.mini-list { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; padding: 0; margin: 22px 0 0; color: #c6d6f8; }
.mini-list li::before { content: "✓"; color: var(--blue); margin-right: 8px; }
.hero-card { padding: 24px; }
.mock-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mock-metric { padding: 16px; }
.mock-metric strong { display: block; font-size: 2rem; margin: 6px 0; }
.mock-chart { height: 250px; margin-top: 16px; position: relative; overflow: hidden; background:
  linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
  rgba(4,10,20,.68);
  background-size: 100% 50px, 64px 100%;
}
.mock-chart::before, .mock-chart::after {
  content: "";
  position: absolute;
  left: 6%;
  width: 88%;
  height: 4px;
  border-radius: 999px;
  transform: skewY(-8deg);
}
.mock-chart::before { top: 35%; border-top: 4px dashed rgba(180,195,225,.36); }
.mock-chart::after { top: 62%; border-top: 5px solid var(--blue); box-shadow: 0 0 22px rgba(46,124,255,.5); }
.qr-mini { position: absolute; right: -18px; bottom: -24px; width: 174px; padding: 16px; text-align: center; }
.qr, .qr-large {
  position: relative;
  margin: 14px auto;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #fff 10px, transparent 10px) 0 0/22px 22px,
    linear-gradient(#fff 10px, transparent 10px) 0 0/22px 22px,
    linear-gradient(90deg, transparent 12px, #fff 12px) 0 0/22px 22px,
    linear-gradient(transparent 12px, #fff 12px) 0 0/22px 22px,
    #fff;
  overflow: hidden;
}
.qr { width: 112px; height: 112px; }
.qr-large { width: 270px; height: 270px; }
.qr::after, .qr-large::after {
  content: "WA";
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  font-weight: 900;
  display: grid;
  place-items: center;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(37,211,102,.45);
}
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; padding: 20px; margin-top: 18px; text-align: center; }
.compare strong { display: block; font-size: 2.1rem; }
.vs { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(46,124,255,.14); color: #accdff; border: 1px solid rgba(46,124,255,.3); font-weight: 900; }

.section { padding: 78px 0; }
.section-head { margin-bottom: 28px; }
.section-head.center { text-align: center; }
.section-head h2 { margin: 12px 0; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; letter-spacing: -.04em; }
.grid-3, .grid-2, .pricing { display: grid; gap: 18px; }
.pricing { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.step, .feature, .price-card { padding: 24px; }
.step-num { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--blue2)); font-weight: 900; margin-bottom: 14px; }
.feature h3, .step h3, .price-card h3 { margin-top: 0; }
.price-card.featured { background: linear-gradient(180deg, rgba(46,124,255,.17), rgba(10,18,33,.86)); border-color: rgba(46,124,255,.3); }
.price { font-size: 2.6rem; font-weight: 900; display: block; margin: 12px 0; }
.price span { color: var(--muted); font-size: 1rem; font-weight: 600; }
.price-card ul { list-style: none; padding: 0; display: grid; gap: 10px; color: var(--muted); margin: 22px 0; }
.price-card li::before { content: "✓"; color: var(--blue); margin-right: 8px; }

.footer { padding: 36px 0 56px; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); }

.auth-layout { min-height: 100vh; display: grid; place-items: center; padding: 30px 0; }
.auth-card { width: min(460px, calc(100% - 28px)); padding: 28px; }
.auth-card h1 { margin: 18px 0 8px; }
.form { display: grid; gap: 14px; margin-top: 22px; }
label span { display: block; color: #c7d5f7; font-size: .9rem; margin-bottom: 8px; }
input, select, textarea {
  width: 100%;
  color: white;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(46,124,255,.55); box-shadow: 0 0 0 4px rgba(46,124,255,.10); }

select {
  color-scheme: dark;
  appearance: auto;
}

select option {
  background: #07101f;
  color: #f5f8ff;
}

select option:checked,
select option:hover {
  background: #1f6fff;
  color: #ffffff;
}

.notice { padding: 13px 14px; border-radius: 14px; background: rgba(46,124,255,.12); color: #d8e7ff; border: 1px solid rgba(46,124,255,.18); }
.notice.error { background: rgba(255,93,115,.12); color: #ffd9df; border-color: rgba(255,93,115,.18); }
.notice.success { background: rgba(45,213,132,.12); color: #ceffdf; border-color: rgba(45,213,132,.18); }

.app-shell { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; padding: 18px; min-height: 100vh; }
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.side-nav { display: grid; gap: 8px; }
.side-nav button, .side-nav a {
  border: 0;
  width: 100%;
  text-align: left;
  color: #c8d7f7;
  background: transparent;
  padding: 13px 14px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
}
.side-nav button.active, .side-nav button:hover, .side-nav a:hover { background: rgba(46,124,255,.14); color: white; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }

.main { padding: 6px 0 40px; }
.app-top { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.app-top h1 { margin: 0 0 7px; font-size: 2.2rem; letter-spacing: -.04em; }
.user-chip { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, rgba(46,124,255,.55), rgba(255,255,255,.08)); font-weight: 900; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 18px; }
.metric strong { display: block; font-size: 2rem; margin: 6px 0; }
.metric small { color: var(--green); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .7fr); gap: 18px; align-items: start; }
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.dashboard-chart { height: 260px; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.client-card { padding: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; font-size: .9rem; }
th { color: #bdd0f2; }
.tag { padding: 7px 10px; border-radius: 999px; display: inline-flex; font-size: .78rem; font-weight: 800; border: 1px solid transparent; }
.wa-box { text-align: center; }
.wa-box .qr-large { margin-top: 18px; }
.instructions { list-style: decimal; color: var(--muted); line-height: 1.8; padding-left: 22px; text-align: left; }
.hidden { display: none !important; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal-card { width: min(560px, 100%); padding: 24px; }
.modal-card h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.admin-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tabs button { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #d9e5ff; border-radius: 999px; padding: 10px 14px; }
.admin-tabs button.active { background: rgba(46,124,255,.16); color: white; border-color: rgba(46,124,255,.25); }

@media (max-width: 1120px) {
  .hero, .content-grid { grid-template-columns: 1fr; }
  .mock-row, .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .pricing { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .app-top { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .header-inner { height: auto; padding: 16px 0; align-items: flex-start; flex-direction: column; }
  .nav { flex-wrap: wrap; gap: 12px; }
  .hero { padding: 42px 0; }
  .mock-row, .metrics, .grid-3, .grid-2, .pricing, .cards-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 3rem; }
  .compare { grid-template-columns: 1fr; }
  .qr-mini { position: static; width: 100%; margin-top: 18px; }
}


.qr-img {
  width: 270px;
  max-width: 100%;
  border-radius: 22px;
  margin: 18px auto;
  background: #fff;
  padding: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35), 0 0 30px rgba(46, 124, 255, .14);
}

.qr-large.hidden, .qr.hidden {
  display: none;
}

/* Ajustes premium/responsive TrueLead */
.session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  color: #dce9ff;
  background: rgba(46,124,255,.12);
  border: 1px solid rgba(46,124,255,.20);
  font-size: .84rem;
  font-weight: 800;
}

.btn.is-disabled,
button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.notice.subtle {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.08);
  color: #c9d8f7;
}

.mock-chart::before,
.mock-chart::after {
  z-index: 1;
}

.mock-chart::before {
  width: 70%;
  opacity: .75;
}

.mock-chart::after {
  width: 70%;
}

.qr-mini {
  z-index: 3;
  right: 14px;
  bottom: 20px;
  background: rgba(10,18,33,.96);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.panel-head,
.actions {
  min-width: 0;
}

.table-wrap {
  border-radius: 16px;
}

.app-shell .metric,
.app-shell .panel,
.app-shell .client-card {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { padding: 12px; gap: 12px; }
  .sidebar { border-radius: 18px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-nav button, .side-nav a { justify-content: center; text-align: center; padding: 12px 10px; }
  .sidebar-bottom { margin-top: 0; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .modal-card { max-height: calc(100vh - 28px); overflow: auto; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 24px, 1220px); }
  .hero h1 { font-size: clamp(2.55rem, 12vw, 3.4rem); }
  .hero p { font-size: 1rem; }
  .mock-metric strong, .metric strong { font-size: 1.65rem; }
  .mock-chart { height: 220px; }
  .mock-chart::before, .mock-chart::after { width: 58%; }
  .qr-mini { position: absolute; right: 12px; bottom: 14px; width: 148px; padding: 12px; }
  .qr-mini .qr { width: 92px; height: 92px; }
  .compare strong { font-size: 1.7rem; }
  .app-top { gap: 12px; }
  .app-top h1 { font-size: 1.9rem; }
  .panel, .auth-card { padding: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  th, td { padding: 11px 10px; }
  table { min-width: 760px; }
}

@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .nav { width: 100%; justify-content: space-between; font-size: .88rem; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .hero-actions .btn { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .side-nav { grid-template-columns: 1fr; }
  .modal-actions .btn { width: 100%; }
  .pricing, .grid-3, .grid-2 { gap: 12px; }
}

/* Home responsive refresh + manual lead phone */
.marketing-page .tl-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: clamp(28px, 5vw, 70px);
}
.tl-hero-copy h1 { max-width: 760px; }
.tl-hero-visual { position: relative; min-height: 560px; display: grid; place-items: center; }
.tl-phone-card {
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top, rgba(46,124,255,.22), transparent 42%),
    rgba(7, 16, 31, .96);
  position: relative;
  overflow: hidden;
}
.tl-phone-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.06);
  pointer-events: none;
}
.phone-top { display: flex; gap: 7px; margin-bottom: 26px; }
.phone-top span { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.20); }
.lead-feed-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
}
.lead-feed-card.active { border-color: rgba(45,213,132,.25); background: rgba(45,213,132,.08); }
.lead-feed-card.proof { border-color: rgba(46,124,255,.22); }
.lead-feed-card.wide { grid-column: 1 / -1; margin: 0; }
.lead-feed-card small { display: block; color: var(--muted); margin-top: 3px; }
.lead-feed-card em { font-style: normal; font-size: .78rem; font-weight: 900; color: #cfe1ff; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.11);
  font-weight: 900;
}
.avatar.blue { background: rgba(46,124,255,.18); }
.avatar.green { background: rgba(45,213,132,.18); color: #ceffdf; }
.phone-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.phone-bottom > div { padding: 18px; border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.07); }
.phone-bottom strong { font-size: 2.1rem; display: block; }
.phone-bottom small { color: var(--muted); }
.tl-floating {
  position: absolute;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(10,18,33,.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}
.tl-floating small { color: var(--muted); }
.tl-float-1 { top: 78px; right: 2px; }
.tl-float-2 { left: 4px; bottom: 96px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.green-dot { background: var(--green); box-shadow: 0 0 18px rgba(45,213,132,.55); }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.problem-grid .feature { min-height: 230px; }
.problem-icon { color: var(--blue); font-weight: 900; letter-spacing: .08em; }
.solution-section { position: relative; }
.steps-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step-card { padding: 22px; position: relative; overflow: hidden; }
.step-card b {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(46,124,255,.18);
  color: #d9e9ff;
  border: 1px solid rgba(46,124,255,.25);
}
.feature-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(320px, .8fr); gap: 24px; align-items: center; margin-bottom: 20px; }
.feature-split h2 { font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.05; letter-spacing: -.04em; }
.mini-dashboard { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-stat { padding: 18px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.mini-stat span { color: var(--muted); display: block; margin-bottom: 8px; }
.mini-stat strong { font-size: 2.2rem; }
.mini-stat.good strong { color: var(--green); }
.features-bottom { margin-top: 18px; }
.final-cta { margin-top: 40px; margin-bottom: 48px; padding: clamp(24px, 4vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.final-cta h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 12px 0; letter-spacing: -.04em; }
.phone-cell { display: grid; gap: 5px; align-items: start; min-width: 130px; }
.phone-cell strong { font-size: .92rem; }
.mini-link {
  border: 0;
  background: transparent;
  color: #8ab7ff;
  padding: 0;
  width: max-content;
  font-weight: 900;
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mini-link:hover { color: white; }

@media (max-width: 1040px) {
  .marketing-page .tl-hero,
  .feature-split { grid-template-columns: 1fr; }
  .tl-hero-visual { min-height: auto; padding: 24px 0 10px; }
  .tl-floating { position: static; margin-top: 12px; width: min(430px, 100%); justify-self: center; }
  .steps-line { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .marketing-header .header-inner { align-items: stretch; }
  .marketing-header .nav { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .marketing-header .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .marketing-header .actions .session-chip { grid-column: 1 / -1; justify-content: center; }
  .tl-phone-card { border-radius: 26px; padding: 16px; }
  .lead-feed-card { grid-template-columns: auto minmax(0, 1fr); }
  .lead-feed-card em { grid-column: 2; }
  .phone-bottom, .mini-dashboard, .steps-line { grid-template-columns: 1fr; }
  .final-cta { display: grid; }
  .final-cta .hero-actions { width: 100%; }
  .final-cta .btn { flex: 1; }
}


/* Panel agency/admin premium refresh + clean responsive tables */
.dashboard-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
}
.app-sidebar {
  background:
    radial-gradient(circle at 16% 0%, rgba(46,124,255,.20), transparent 38%),
    rgba(6, 13, 27, .92);
  border-color: rgba(255,255,255,.095);
}
.app-sidebar .brand {
  padding: 7px 6px 16px;
}
.app-sidebar .brand img {
  filter: drop-shadow(0 12px 24px rgba(46,124,255,.26));
}
.side-nav {
  gap: 8px;
}
.side-nav button,
.side-nav a {
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #b8c8e8;
  position: relative;
  overflow: hidden;
}
.side-nav button::before,
.side-nav a::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(46,124,255,.0);
  box-shadow: 0 0 0 rgba(46,124,255,0);
  transition: .18s ease;
}
.side-nav button.active,
.side-nav button:hover,
.side-nav a:hover {
  color: #fff;
  border-color: rgba(46,124,255,.18);
  background: linear-gradient(135deg, rgba(46,124,255,.18), rgba(255,255,255,.04));
}
.side-nav button.active::before,
.side-nav button:hover::before,
.side-nav a:hover::before {
  background: var(--blue);
  box-shadow: 0 0 18px rgba(46,124,255,.72);
}
.sidebar-bottom .soft {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}
.main {
  min-width: 0;
}
.premium-top {
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 10%, rgba(46,124,255,.16), transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  box-shadow: 0 20px 70px rgba(0,0,0,.24);
  margin-bottom: 18px;
}
.top-copy {
  min-width: 0;
}
.top-copy h1,
.premium-top h1 {
  margin: 8px 0 4px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -.055em;
  line-height: 1;
}
.live-badge {
  background: rgba(45,213,132,.10);
  color: #cdfdde;
  border-color: rgba(45,213,132,.18);
}
.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(45,213,132,.85);
}
.top-actions select,
.top-actions input {
  background: rgba(5,11,22,.72);
  border-color: rgba(255,255,255,.12);
}
.metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.metric-strip .metric {
  min-height: 132px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
    rgba(8, 17, 32, .85);
  position: relative;
}
.metric-strip .metric::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -28px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(46,124,255,.12);
  filter: blur(2px);
}
.metric-strip .metric label {
  color: #aabbe0;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.metric-strip .metric strong {
  position: relative;
  z-index: 1;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -.04em;
}
.metric-strip .metric small {
  color: #93a7ca;
  line-height: 1.45;
}
.panel-section {
  animation: panelFade .22s ease both;
}
@keyframes panelFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.content-grid {
  align-items: start;
}
.panel {
  padding: clamp(18px, 2.5vw, 24px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022)),
    rgba(7, 15, 29, .88);
}
.panel-head {
  margin-bottom: 16px;
  gap: 14px;
}
.panel-head h2 {
  margin: 0;
  letter-spacing: -.025em;
}
.notice {
  border-radius: 18px;
  line-height: 1.5;
}
.table-wrap {
  background: rgba(3,8,17,.42);
  border: 1px solid rgba(255,255,255,.07);
  overflow: auto;
}
table {
  border-collapse: separate;
  border-spacing: 0;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(7, 15, 29, .96);
  color: #d8e6ff;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}
td {
  color: #edf4ff;
  vertical-align: top;
}
tbody tr {
  transition: background .15s ease, transform .15s ease;
}
tbody tr:hover {
  background: rgba(46,124,255,.055);
}
.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}
.client-card,
.cards-grid .soft,
.cards-grid .card {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  border-color: rgba(255,255,255,.085);
}
.phone-cell strong {
  color: #f7fbff;
  word-break: break-word;
}
.mini-link {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 0;
}
.form {
  gap: 13px;
}
.form label span {
  font-size: .79rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #b7caed;
}
input, select, textarea {
  background: rgba(3,8,17,.74);
  border-color: rgba(255,255,255,.12);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(46,124,255,.55);
  box-shadow: 0 0 0 4px rgba(46,124,255,.12);
}
.qr-large {
  min-height: 180px;
  border: 1px dashed rgba(46,124,255,.26);
  background: rgba(46,124,255,.055);
  border-radius: 22px;
  display: grid;
  place-items: center;
}
.qr-large:empty::before {
  content: 'QR pendiente';
  color: #93a9ce;
  font-weight: 800;
}
.admin-shell .table-wrap table {
  min-width: 980px;
}
.admin-shell [data-agencies-table] .actions,
.admin-shell [data-payments-table] .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(105px, 1fr));
  gap: 8px;
}
.admin-shell [data-agencies-table] .btn,
.admin-shell [data-payments-table] .btn {
  width: 100%;
}
@media (max-width: 1080px) {
  .premium-top .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .premium-top .user-chip { justify-self: end; }
}
@media (max-width: 900px) {
  .dashboard-shell {
    width: 100%;
  }
  .app-sidebar {
    position: sticky;
    top: 8px;
    z-index: 30;
    backdrop-filter: blur(16px);
  }
  .side-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: auto;
    padding-bottom: 4px;
  }
  .side-nav button,
  .side-nav a {
    white-space: nowrap;
    min-height: 42px;
    font-size: .85rem;
  }
  .sidebar-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
  }
  .sidebar-bottom .btn-full {
    width: auto;
    min-width: 140px;
  }
}
@media (max-width: 680px) {
  body {
    background: #040915;
  }
  .app-shell {
    padding: 10px;
  }
  .premium-top {
    border-radius: 22px;
  }
  .premium-top .top-actions {
    grid-template-columns: 1fr;
  }
  .premium-top .user-chip {
    justify-self: start;
  }
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar-bottom {
    grid-template-columns: 1fr;
  }
  .sidebar-bottom .btn-full {
    width: 100%;
  }
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-strip .metric {
    min-height: 118px;
    padding: 14px;
  }
  .metric-strip .metric label {
    font-size: .68rem;
  }
  .metric-strip .metric strong {
    font-size: 1.7rem;
  }
  .table-wrap {
    margin-inline: -2px;
  }
  .admin-shell [data-agencies-table] .actions,
  .admin-shell [data-payments-table] .actions {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .metric-strip {
    grid-template-columns: 1fr;
  }
  .side-nav {
    grid-template-columns: 1fr;
  }
}


/* UI polish patch */
.overview-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.overview-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .7fr);
  align-items: stretch;
}
.overview-grid > .panel,
.overview-grid > .wa-box {
  min-height: 100%;
}
.overview-metrics .metric:last-child {
  background:
    radial-gradient(circle at 85% 12%, rgba(45, 213, 132, .12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
    rgba(8, 17, 32, .85);
}
.overview-metrics .metric:last-child strong {
  color: #eaf6ff;
}
.table-wrap {
  border-radius: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 134, 201, .7) rgba(255,255,255,.04);
}
.table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(96, 134, 201, .75);
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
  border-radius: 999px;
}
.wa-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.wa-box .panel-head {
  align-items: center;
}
.wa-box .panel-head h2 {
  line-height: 1.05;
}
.wa-box .muted {
  text-align: center;
}
.wa-box .actions {
  margin-top: auto;
}
.wa-box .qr-large {
  width: 100%;
  max-width: 290px;
  min-height: 230px;
  margin: 8px auto 14px;
  background: linear-gradient(180deg, rgba(10,20,38,.92), rgba(13,25,46,.86));
  border: 1px dashed rgba(77, 118, 190, .34);
  overflow: hidden;
}
.wa-box .qr-large::after {
  display: none;
}
.wa-box .qr-large.is-empty::before {
  content: 'QR pendiente';
  color: #93a9ce;
  font-weight: 800;
}
.wa-box .qr-large.is-connecting::before {
  content: 'Conectando WhatsApp…';
  color: #d5e3ff;
  font-weight: 800;
}
.wa-box .qr-large.is-connected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  text-align: left;
  border-style: solid;
  border-color: rgba(45,213,132,.22);
  background:
    radial-gradient(circle at 50% 30%, rgba(45,213,132,.12), transparent 26%),
    linear-gradient(180deg, rgba(10,20,38,.94), rgba(13,25,46,.88));
}
.wa-preview-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #1fb85a);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(37,211,102,.28);
}
.wa-preview-copy {
  display: grid;
  gap: 6px;
}
.wa-preview-copy strong {
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: #f4f8ff;
}
.wa-preview-copy span {
  color: #96add3;
  line-height: 1.45;
  word-break: break-word;
}
@media (max-width: 1280px) {
  .overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .overview-metrics {
    grid-template-columns: 1fr;
  }
  .wa-box .qr-large.is-connected {
    flex-direction: column;
    text-align: center;
  }
}


/* layout balance tweaks */
.dashboard-shell {
  width: min(1840px, calc(100vw - 24px));
}
.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
}
.sidebar {
  top: 12px;
  height: calc(100vh - 24px);
}
.side-nav button[data-tab="whatsapp"] {
  justify-content: flex-start;
  gap: 10px;
}
.overview-metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.overview-metrics .metric {
  min-height: 118px;
  padding: 16px;
}
.overview-metrics .metric strong {
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
}
.overview-metrics .metric small {
  font-size: .9rem;
}
.content-grid.overview-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, .68fr);
}
.wa-box {
  min-width: 0;
}
.wa-box .panel-head {
  justify-content: space-between;
}
@media (max-width: 1680px) {
  .overview-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  .overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .dashboard-shell {
    width: 100%;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* SaaS pro polish pass */
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(46,124,255,.13), transparent 32%),
    radial-gradient(circle at 95% 10%, rgba(45,213,132,.08), transparent 28%),
    linear-gradient(180deg, #041024 0%, #030813 54%, #02050d 100%);
}
.dashboard-shell {
  max-width: none;
}
.app-sidebar {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 24px 90px rgba(0,0,0,.30);
}
.app-sidebar .brand span {
  letter-spacing: -.02em;
}
.side-nav button,
.side-nav a {
  justify-content: flex-start;
  gap: 10px;
  font-weight: 800;
}
.side-nav button > span:last-child,
.side-nav a > span:last-child {
  min-width: 0;
}
.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #9ebaff;
  background: rgba(46,124,255,.09);
  border: 1px solid rgba(46,124,255,.12);
  font-weight: 900;
  flex: 0 0 28px;
}
.side-nav button.active .nav-ico,
.side-nav button:hover .nav-ico,
.side-nav a:hover .nav-ico {
  color: #fff;
  background: rgba(46,124,255,.24);
  border-color: rgba(46,124,255,.34);
}
.side-nav button[data-tab="whatsapp"] .pill {
  order: 0;
  flex: 0 0 auto;
}
.premium-top {
  position: relative;
  overflow: hidden;
}
.premium-top::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, rgba(255,255,255,.42), transparent 68%);
}
.premium-top > * {
  position: relative;
  z-index: 1;
}
.notice.subtle,
[data-phone-policy] {
  background:
    linear-gradient(135deg, rgba(46,124,255,.12), rgba(45,213,132,.055));
  border-color: rgba(107, 153, 255, .18);
}
.metric-strip .metric {
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    0 16px 45px rgba(0,0,0,.14);
}
.metric-strip .metric::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 24px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 24%, rgba(46,124,255,.30) 25% 30%, transparent 31% 48%, rgba(45,213,132,.22) 49% 54%, transparent 55%);
  opacity: .18;
}
.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(46,124,255,.15);
  border: 1px solid rgba(46,124,255,.18);
  color: #dbe8ff;
  font-weight: 900;
  font-size: .86rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.metric-strip .metric:nth-child(4) .metric-icon,
.metric-strip .metric:nth-child(7) .metric-icon {
  background: rgba(45,213,132,.14);
  border-color: rgba(45,213,132,.20);
}
.panel {
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 18px 60px rgba(0,0,0,.18);
}
.panel-head {
  align-items: flex-start;
}
.panel-subtitle {
  margin: 5px 0 0;
  color: #91a7cc;
  font-size: .92rem;
  line-height: 1.35;
}
.table-wrap {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
table {
  min-width: 920px;
}
th {
  padding-top: 14px;
  padding-bottom: 14px;
}
td {
  padding-top: 15px;
  padding-bottom: 15px;
}
tbody tr {
  background: rgba(255,255,255,.012);
}
tbody tr + tr td {
  border-top: 1px solid rgba(255,255,255,.065);
}
.lead-code {
  display: grid;
  gap: 5px;
}
.lead-code strong {
  display: inline-flex;
  width: fit-content;
  max-width: 120px;
  color: #ffffff;
  font-size: .95rem;
  line-height: 1.12;
  word-break: break-word;
}
.lead-code span {
  width: fit-content;
  color: #92a8d0;
  background: rgba(46,124,255,.10);
  border: 1px solid rgba(46,124,255,.12);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.phone-cell {
  display: grid;
  gap: 4px;
}
.phone-cell strong {
  display: block;
}
.mini-link {
  color: #aecdff;
  font-weight: 900;
}
.tag,
.status,
.pill,
.badge {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.wa-box {
  overflow: hidden;
}
.wa-box .qr-large {
  min-height: 250px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 24px 70px rgba(0,0,0,.17);
}
.wa-preview-icon {
  animation: waPulse 2.4s ease-in-out infinite;
}
@keyframes waPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(37,211,102,.28), 0 0 0 0 rgba(37,211,102,.18); }
  50% { box-shadow: 0 10px 24px rgba(37,211,102,.30), 0 0 0 12px rgba(37,211,102,0); }
}
.client-card h3,
.panel h2 {
  letter-spacing: -.035em;
}
.btn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.btn-primary {
  background: linear-gradient(135deg, #2f7cff, #2465f2 52%, #1554df);
}
.btn-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
}
.modal-card {
  box-shadow: 0 30px 120px rgba(0,0,0,.50);
}
.admin-shell .panel,
.admin-shell .metric {
  border-radius: 24px;
}
@media (min-width: 1681px) {
  .overview-metrics .metric {
    min-height: 108px;
  }
  .content-grid.overview-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(360px, .55fr);
  }
}
@media (max-width: 680px) {
  table {
    min-width: 780px;
  }
  .metric-top {
    margin-bottom: 4px;
  }
  .metric-icon {
    width: 28px;
    height: 28px;
  }
  .panel-subtitle {
    font-size: .86rem;
  }
}


/* Mobile navigation fix: menu should not cover the panel */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
  }

  .dashboard-shell,
  .app-shell {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .app-sidebar,
  .sidebar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    z-index: 1 !important;
    border-radius: 20px !important;
    padding: 12px !important;
  }

  .app-sidebar .brand {
    padding: 4px 4px 10px !important;
  }

  .app-sidebar .brand img {
    width: 38px;
    height: 38px;
  }

  .side-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 2px 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav button,
  .side-nav a {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 40px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: .86rem !important;
    white-space: nowrap !important;
  }

  .side-nav .nav-ico {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 9px;
  }

  .side-nav .pill {
    padding: 4px 8px;
    font-size: .7rem;
  }

  .sidebar-bottom {
    margin-top: 8px !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sidebar-bottom .soft {
    display: none;
  }

  .sidebar-bottom .btn-full {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
  }

  .main {
    width: 100%;
    min-width: 0;
    padding: 0 0 24px !important;
  }

  .premium-top {
    margin-top: 0 !important;
  }

  .premium-top .top-actions {
    grid-template-columns: 1fr 1fr !important;
    align-items: center;
  }

  .premium-top .top-actions select,
  .premium-top .top-actions input,
  .premium-top .top-actions button {
    width: 100%;
    max-width: none !important;
  }

  .premium-top .user-chip {
    display: none;
  }

  .content-grid,
  .content-grid.overview-grid {
    grid-template-columns: 1fr !important;
  }

  .panel,
  .wa-box {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .dashboard-shell,
  .app-shell {
    padding: 8px !important;
  }

  .premium-top {
    padding: 18px !important;
    border-radius: 20px !important;
  }

  .premium-top h1 {
    font-size: 2.25rem !important;
  }

  .premium-top .top-actions {
    grid-template-columns: 1fr !important;
  }

  .overview-metrics,
  .metric-strip {
    grid-template-columns: 1fr !important;
  }

  .table-wrap {
    max-width: 100%;
  }
}


/* HARD MOBILE FIX: real app layout for phones */
@media (max-width: 760px) {
  :root {
    --mobile-pad: 10px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden !important;
  }

  body {
    font-size: 14px;
  }

  .dashboard-shell,
  .app-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: var(--mobile-pad) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  .app-sidebar,
  .sidebar {
    width: 100% !important;
    max-width: calc(100vw - (var(--mobile-pad) * 2)) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    position: relative !important;
    inset: auto !important;
    padding: 12px !important;
    margin: 0 0 10px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  .app-sidebar .brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 2px 10px !important;
    margin: 0 !important;
  }

  .app-sidebar .brand img {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
  }

  .app-sidebar .brand span {
    font-size: .95rem !important;
    letter-spacing: -.02em !important;
  }

  .side-nav {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 4px !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav button,
  .side-nav a {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    max-width: 170px !important;
    min-height: 38px !important;
    padding: 9px 11px !important;
    border-radius: 13px !important;
    font-size: .82rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    scroll-snap-align: start;
  }

  .side-nav .nav-ico {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
    border-radius: 8px !important;
    font-size: .75rem !important;
  }

  .side-nav .pill {
    padding: 4px 7px !important;
    font-size: .66rem !important;
  }

  .sidebar-bottom {
    display: none !important;
  }

  .main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 0 24px !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  .premium-top {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    margin: 0 0 12px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  .premium-top,
  .app-top {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .top-copy h1,
  .premium-top h1 {
    font-size: 2.15rem !important;
    line-height: .98 !important;
    margin: 8px 0 6px !important;
    letter-spacing: -.055em !important;
  }

  .top-copy .muted,
  .premium-top .muted {
    font-size: .95rem !important;
    line-height: 1.35 !important;
  }

  .top-actions,
  .premium-top .top-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-items: center !important;
  }

  .top-actions select,
  .top-actions input,
  .top-actions button,
  .premium-top .top-actions select,
  .premium-top .top-actions input,
  .premium-top .top-actions button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    border-radius: 14px !important;
    font-size: .9rem !important;
  }

  .top-actions button,
  .premium-top .top-actions button {
    width: auto !important;
    min-width: 92px !important;
    padding-inline: 14px !important;
  }

  .top-actions .hidden,
  .premium-top .top-actions .hidden,
  input.hidden,
  .hidden[data-range-from],
  .hidden[data-range-to] {
    display: none !important;
  }

  .premium-top .user-chip {
    display: none !important;
  }

  [data-phone-policy],
  .notice {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 13px !important;
    border-radius: 16px !important;
    font-size: .88rem !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
  }

  .panel-section,
  .content-grid,
  .content-grid.overview-grid,
  .metrics,
  .metric-strip,
  .overview-metrics,
  .cards-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 1fr !important;
  }

  .overview-metrics {
    gap: 10px !important;
  }

  .metric,
  .metric-strip .metric,
  .overview-metrics .metric {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 108px !important;
    padding: 15px !important;
    border-radius: 18px !important;
  }

  .metric-strip .metric strong,
  .overview-metrics .metric strong {
    font-size: 2rem !important;
  }

  .metric-strip .metric small,
  .overview-metrics .metric small {
    font-size: .88rem !important;
  }

  .panel,
  .wa-box,
  .client-card,
  .soft {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  .panel-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .panel-head h2 {
    font-size: 1.25rem !important;
  }

  .panel-subtitle {
    font-size: .84rem !important;
  }

  .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    border-radius: 16px !important;
  }

  table {
    min-width: 760px !important;
  }

  th,
  td {
    padding: 12px 10px !important;
    font-size: .82rem !important;
  }

  .wa-box .qr-large {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 190px !important;
    border-radius: 18px !important;
  }

  .wa-box .actions {
    width: 100% !important;
  }

  .wa-box .actions .btn {
    width: 100% !important;
  }

  .modal-card {
    width: calc(100vw - 18px) !important;
    max-width: calc(100vw - 18px) !important;
    max-height: calc(100vh - 18px) !important;
    overflow-y: auto !important;
    border-radius: 20px !important;
  }
}

@media (max-width: 380px) {
  .top-copy h1,
  .premium-top h1 {
    font-size: 1.9rem !important;
  }

  .top-actions,
  .premium-top .top-actions {
    grid-template-columns: 1fr !important;
  }

  .top-actions button,
  .premium-top .top-actions button {
    width: 100% !important;
  }
}
