:root {
  --bg: #070b10;
  --surface: #0f151c;
  --elevated: #171e28;
  --line: #243041;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --dim: #5a6b80;
  --gold: #d4a853;
  --live: #3ddcff;
  --call: #2ee6a6;
  --put: #ff5c6a;
  --font: "Space Grotesk", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --display: "Syne", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 220, 255, 0.08), transparent 50%),
    radial-gradient(900px 400px at 90% 0%, rgba(212, 168, 83, 0.07), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #3a2a0a;
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}
.impersonate-banner[hidden] { display: none !important; }
.impersonate-banner .ghost {
  padding: 6px 12px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--text);
  background: rgba(212, 168, 83, 0.15);
}
.impersonate-banner .ghost:hover {
  background: rgba(212, 168, 83, 0.28);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
}
.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.muted { color: var(--muted); margin: 0; }
.error, .msg.err { color: var(--put); min-height: 1.2em; }
.msg { margin-top: 4px; font-size: 13px; }
.msg.ok { color: var(--call); }

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--elevated);
}
textarea { resize: vertical; line-height: 1.45; min-height: 110px; font-family: var(--mono); font-size: 12px; }

.primary, .btn-primary, .login-card button[type="submit"] {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(212, 168, 83, 0.16);
  border: 1px solid rgba(212, 168, 83, 0.45);
  color: var(--gold);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.ghost, .btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  background: transparent;
}
.btn-green {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(46, 230, 166, 0.14);
  border: 1px solid rgba(46, 230, 166, 0.4);
  color: var(--call);
  font-weight: 650;
}
.btn-danger {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 92, 106, 0.12);
  border: 1px solid rgba(255, 92, 106, 0.4);
  color: var(--put);
  font-weight: 650;
}
.actions, .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.actions { margin-top: 14px; }

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  align-items: start;
}
.mobile-bar { display: none; }
.sidebar-backdrop { display: none; }
.desktop-brand { display: block; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #0b1016;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  align-self: start;
}
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
}
.brand span { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav {
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  color: var(--muted);
  width: 100%;
}
.nav.active {
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
  font-weight: 700;
}
.nav-wa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wa-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dim);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.wa-dot.online {
  background: var(--call);
  box-shadow: 0 0 8px rgba(46, 230, 166, 0.55);
}
.wa-dot.offline {
  background: var(--put);
  box-shadow: 0 0 8px rgba(255, 92, 106, 0.45);
}
.sinais-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.sinais-tab {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.sinais-tab.active {
  border-color: rgba(212, 168, 83, 0.45);
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
}
.sinais-panel.hidden { display: none !important; }
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-status {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--elevated);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.5;
}

main { padding: 28px 32px 48px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.top h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.03em;
}
.top p { margin: 6px 0 0; color: var(--dim); font-family: var(--mono); font-size: 12px; }

.card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 6px; font-size: 18px; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.period {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.period h3 {
  margin: 0;
  font-size: 15px;
  color: var(--live);
}
.period .hm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-direction: row;
}
.switch input { width: auto; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.counters {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.qr {
  margin-top: 16px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
}
.qr img, img.qr-img { width: min(280px, 100%); height: auto; display: block; }
.qr.hidden, .qr[hidden] { display: none !important; }

.tpl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tpl-tabs button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.tpl-tabs button.active {
  border-color: rgba(61, 220, 255, 0.5);
  color: var(--live);
  background: rgba(61, 220, 255, 0.08);
}

.group-list {
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--elevated);
}
.group-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(36, 48, 65, 0.8);
  cursor: pointer;
  flex-direction: row;
}
.group-item:last-child { border-bottom: 0; }
.group-item:hover { background: rgba(61, 220, 255, 0.04); }
.group-item input { margin-top: 3px; width: auto; }
.group-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.group-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.group-item span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  word-break: break-all;
}

.actives-section {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card, rgba(255, 255, 255, 0.015));
  overflow: hidden;
}
.actives-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.actives-sum::-webkit-details-marker { display: none; }
.actives-sum::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.actives-section[open] .actives-sum::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.actives-sum strong {
  display: block;
  font-size: 15px;
}
.actives-sum em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.actives-body { padding: 0 16px 16px; }
.actives-group-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(36, 48, 65, 0.8);
  position: sticky;
  top: 0;
}
#activesList { max-height: 360px; }

.signal-schedule {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.sched-period h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.sched-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sched-slot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  min-width: 92px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
}
.sched-time { line-height: 1.2; }
.sched-asset {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  max-width: 110px;
}
.sched-slot.next .sched-asset { color: var(--live); }
.sched-slot.sent .sched-asset { text-decoration: none; }
.sched-slot.skipped {
  opacity: 0.4;
}
.sched-slot small {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sched-slot.sent {
  opacity: 0.45;
  text-decoration: line-through;
}
.sched-slot.next {
  border-color: rgba(61, 220, 255, 0.55);
  background: rgba(61, 220, 255, 0.1);
  color: var(--live);
}
.sched-slot.pending { background: var(--elevated); }
@media (max-width: 900px) {
  .signal-schedule { grid-template-columns: 1fr; }
}

.cm-saved-tag {
  font-style: normal;
  font-family: var(--sans) !important;
  font-size: 10px !important;
  color: var(--gold) !important;
  margin-left: 6px;
}
.cm-forget {
  margin-left: auto;
  padding: 2px 8px !important;
  min-width: 0;
  color: var(--dim);
  flex-shrink: 0;
}
.cm-forget:hover { color: var(--put); }
.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.chip input { width: auto; margin: 0; }
.chip:has(input:checked) {
  border-color: rgba(212, 168, 83, 0.45);
  color: var(--gold);
  background: rgba(212, 168, 83, 0.12);
}

.cm-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cm-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--dim);
  font-size: 13px;
}
.cm-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}
.cm-step-label { font-weight: 600; }
.cm-step.active {
  border-color: rgba(212, 168, 83, 0.45);
  background: rgba(212, 168, 83, 0.1);
  color: var(--text);
}
.cm-step.active .cm-step-num {
  background: rgba(212, 168, 83, 0.2);
  border-color: rgba(212, 168, 83, 0.5);
  color: var(--gold);
}
.cm-step.done {
  border-color: rgba(46, 230, 166, 0.35);
  color: var(--text);
}
.cm-step.done .cm-step-num {
  background: rgba(46, 230, 166, 0.15);
  border-color: rgba(46, 230, 166, 0.4);
  color: var(--call);
}
.cm-panel { margin-top: 4px; }
.cm-dest-block {
  margin-top: 18px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.cm-dest-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 650;
}
.cm-panel-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-family: var(--display);
}
.cm-mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.cm-mode-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  cursor: pointer;
  color: var(--muted);
}
.cm-mode-card input { width: auto; margin-bottom: 4px; }
.cm-mode-card strong { color: var(--text); font-size: 14px; }
.cm-mode-card span { font-size: 12px; line-height: 1.35; }
.cm-mode-card:has(input:checked) {
  border-color: rgba(212, 168, 83, 0.5);
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
}
.cm-summary {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #0b1016;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}
.cm-nav { margin-top: 18px; }

.cms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cms-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--elevated);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cms-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  margin-top: auto;
}
.cms-card-actions .primary,
.cms-card-actions .ghost {
  flex: 1;
}
.cms-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--elevated);
}
.cms-editor {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}
.cms-preview {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1016;
  padding: 14px;
  min-height: 160px;
}
.cms-bubble {
  max-width: 100%;
  background: #14202c;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 6px;
  overflow: hidden;
}
.cms-bubble img,
.cms-bubble video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #000;
}
.cms-bubble video.cms-ptv {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  max-height: 220px;
  width: 220px;
  max-width: 100%;
  margin: 12px auto;
}
.cms-bubble-body {
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.cms-bubble-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}
.cms-flag {
  font-size: 11px;
  font-weight: 650;
  color: var(--gold);
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
}
.cms-preview-empty {
  color: var(--dim);
  font-size: 13px;
  text-align: center;
  padding: 36px 12px;
}

@media (max-width: 960px) {
  .cm-steps, .cm-mode-cards { grid-template-columns: 1fr; }
  .cms-editor { grid-template-columns: 1fr; }
}
.group-empty {
  padding: 20px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.group-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 20px;
  text-align: center;
  min-height: 160px;
}
.group-loading .spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.85s linear infinite;
}
.group-loading strong {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.group-loading p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.45;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.preview {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 10px;
  background: #0b1016;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  min-height: 80px;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.cm-when { white-space: nowrap; }
.cm-when small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  font-weight: 400;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
}
.badge.pending { background: rgba(212, 168, 83, 0.15); color: var(--gold); }
.badge.approved { background: rgba(46, 230, 166, 0.12); color: var(--call); }
.badge.rejected { background: rgba(255, 92, 106, 0.12); color: var(--put); }
.badge.online { background: rgba(46, 230, 166, 0.14); color: var(--call); }
.badge.offline { background: rgba(148, 163, 184, 0.12); color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 8, 14, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 24px;
  overflow: auto;
}
.modal-backdrop.hidden { display: none !important; }
.modal-panel {
  width: min(920px, 100%);
  background: var(--card, #121820);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.modal-body {
  padding: 16px 20px 22px;
}
.usage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 14px;
}
.usage-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.usage-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.usage-stat strong {
  font-size: 22px;
  font-family: var(--mono);
}
.usage-stat span {
  color: var(--muted);
  font-size: 12px;
}
.usage-section {
  margin: 22px 0 10px;
  font-size: 15px;
}
.table-wrap {
  overflow-x: auto;
}
@media (max-width: 720px) {
  .usage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.view.hidden { display: none !important; }

@media (max-width: 960px) {
  .shell {
    display: block;
  }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #0b1016;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .mobile-brand {
    display: block;
  }
  .mobile-brand strong {
    font-size: 20px;
  }
  .desktop-brand { display: none; }
  .burger {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--elevated);
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 10px;
    flex-shrink: 0;
  }
  .burger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  body.menu-open .burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.menu-open .burger span:nth-child(2) {
    opacity: 0;
  }
  body.menu-open .burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-backdrop[hidden] { display: none; }
  body.menu-open .sidebar-backdrop[hidden] { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 60;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
  }
  body.menu-open .sidebar {
    transform: translateX(0);
  }
  .sidebar nav { flex-direction: column; flex-wrap: nowrap; }
  .grid3, .grid2 { grid-template-columns: 1fr; }
  main { padding: 20px 16px 40px; }
  .cm-steps, .cm-mode-cards { grid-template-columns: 1fr; }
}

/* Landing page editor */
.lp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.lp-editor-head { margin-bottom: 4px; }
.lp-editor-head h2 { margin: 0 0 4px; }
.lp-editor-head .muted { margin: 0; }
.lp-editor-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.lp-section {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}
.lp-section-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lp-section-sum::-webkit-details-marker { display: none; }
.lp-section-sum::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.lp-section[open] .lp-section-sum::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.lp-section-sum:hover { background: rgba(255, 255, 255, 0.02); }
.lp-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.1);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.lp-section-sum strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.lp-section-sum em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.lp-section-body {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(36, 48, 65, 0.8);
}
.lp-sub-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.lp-sub-row input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
  min-width: 0;
}
.lp-sub-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--elevated);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.lp-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lp-color-row input[type="color"] {
  width: 48px;
  height: 44px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--elevated);
  cursor: pointer;
  flex: 0 0 auto;
}
.lp-color-row input[type="text"] {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  text-transform: lowercase;
}
.lp-sub-status { margin: 6px 0 0; font-size: 12px; min-height: 1.2em; }
.lp-sub-status.ok { color: var(--call); }
.lp-sub-status.err { color: var(--put); }
.lp-event-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lp-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lp-event-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.lp-event-chip span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}
.lp-event-chip:hover {
  border-color: rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.06);
}
.lp-event-chip:hover span { color: var(--text); }
.lp-event-chip:has(input:checked) {
  border-color: rgba(212, 168, 83, 0.55);
  background: rgba(212, 168, 83, 0.14);
}
.lp-event-chip:has(input:checked) span {
  color: var(--gold);
  font-weight: 600;
}

.lp-phone {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.lp-phone-screen {
  width: min(100%, 300px);
  min-height: min(78vh, 560px);
  border-radius: 28px;
  border: 2px solid #2a3340;
  background: #050508;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.lp-prev-media {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  background: #050508;
}
.lp-prev-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}
.lp-prev-photo-empty {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 280px;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
  background: linear-gradient(180deg, #1a1224 0%, #050508 100%);
}
.lp-prev-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 72px;
  background: linear-gradient(to bottom, rgba(5,5,8,0), #050508);
  pointer-events: none;
}
.lp-prev-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px 22px;
  text-align: center;
}
.lp-prev-headline {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
}
.lp-prev-headline span {
  display: block;
  width: 100%;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
}
.lp-prev-headline .accent { color: #b859ff; }
.lp-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lp-layout-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lp-layout-btn strong {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}
.lp-layout-btn span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.lp-layout-btn:hover {
  border-color: rgba(212, 168, 83, 0.4);
}
.lp-layout-btn.active {
  border-color: rgba(212, 168, 83, 0.55);
  background: rgba(212, 168, 83, 0.12);
}
.lp-layout-btn.active strong { color: var(--gold); }

.lp-phone-screen.layout-cover {
  position: relative;
}
.lp-phone-screen.layout-cover .lp-prev-media {
  position: absolute;
  inset: 0;
  flex: none;
}
.lp-phone-screen.layout-cover .lp-prev-media img,
.lp-phone-screen.layout-cover .lp-prev-photo-empty {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center top;
}
.lp-phone-screen.layout-cover .lp-prev-fade {
  height: 55%;
  background: linear-gradient(to bottom, rgba(5,5,8,0) 0%, rgba(5,5,8,0.5) 40%, #050508 100%);
}
.lp-phone-screen.layout-cover .lp-prev-content {
  position: relative;
  z-index: 1;
  margin-top: auto;
  justify-content: flex-end;
  background: transparent;
}

.lp-phone-screen.layout-cover-top .lp-prev-media {
  flex: 0 0 54%;
  min-height: 54%;
}
.lp-phone-screen.layout-cover-top .lp-prev-media img,
.lp-phone-screen.layout-cover-top .lp-prev-photo-empty {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center top;
}

.lp-phone-screen.layout-contain .lp-prev-media img {
  object-fit: contain;
  object-position: center center;
  height: auto;
  max-height: 260px;
}
.lp-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lp-icon-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.lp-icon-btn.primary {
  border-color: rgba(46, 230, 166, 0.28);
}
.lp-icon-btn:hover {
  border-color: rgba(212, 168, 83, 0.4);
  color: var(--text);
}
.lp-icon-btn.active {
  border-color: rgba(212, 168, 83, 0.55);
  background: rgba(212, 168, 83, 0.14);
  color: var(--gold);
  font-weight: 650;
}
.lp-prev-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #25d366;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.lp-prev-cta-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.lp-prev-cta-icon:empty { display: none; }
.lp-prev-cta-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

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

/* Links com Redirect */
.rd-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.rd-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.rd-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rd-item-main strong {
  font-size: 15px;
}
.rd-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
}
.rd-item-meta a {
  color: var(--gold);
  word-break: break-all;
}
.rd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.rd-badge.on {
  color: var(--live);
  border-color: color-mix(in srgb, var(--live) 40%, transparent);
}
.rd-badge.off {
  color: var(--muted);
}
.rd-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rd-targets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.rd-target-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.rd-target-row input {
  width: 100%;
}
.rd-stats-total {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  color: var(--gold);
}
.rd-stats-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rd-stats-head {
  align-items: flex-start;
}
.rd-daterange {
  position: relative;
}
.rd-daterange-btn {
  min-width: 168px;
  text-align: left;
}
.rd-daterange-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 280px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--elevated);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.rd-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.rd-cal-head strong {
  font-size: 13px;
  text-transform: capitalize;
}
.rd-cal-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.rd-cal-nav:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.rd-cal-weekdays,
.rd-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.rd-cal-weekdays {
  margin-bottom: 4px;
}
.rd-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  padding: 4px 0;
}
.rd-cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  padding: 0;
}
.rd-cal-day:hover:not(:disabled):not(.in-range):not(.range-start):not(.range-end) {
  background: rgba(212, 168, 83, 0.12);
}
.rd-cal-day:disabled {
  color: var(--dim);
  opacity: 0.35;
  cursor: default;
}
.rd-cal-day.other-month {
  color: var(--dim);
}
.rd-cal-day.in-range {
  background: rgba(212, 168, 83, 0.14);
  border-radius: 0;
}
.rd-cal-day.range-start,
.rd-cal-day.range-end {
  background: rgba(212, 168, 83, 0.28);
  color: var(--gold);
  font-weight: 650;
}
.rd-cal-day.range-start {
  border-radius: 8px 0 0 8px;
}
.rd-cal-day.range-end {
  border-radius: 0 8px 8px 0;
}
.rd-cal-day.range-start.range-end {
  border-radius: 8px;
}
.rd-cal-day.today:not(.range-start):not(.range-end):not(.in-range) {
  box-shadow: inset 0 0 0 1px rgba(212, 168, 83, 0.45);
}
.rd-cal-hint {
  margin: 10px 0 0;
  font-size: 12px;
}
.rd-cal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.rd-cal-foot .primary,
.rd-cal-foot .ghost {
  padding: 8px 12px;
  font-size: 13px;
}
.rd-stats-table {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-stats-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.rd-stats-row span {
  word-break: break-all;
  color: var(--muted);
}
.rd-stats-row strong {
  white-space: nowrap;
}
.rd-stats-recent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  font-size: 12px;
}
.rd-stats-recent .rd-click {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 80%, #000);
  border: 1px solid var(--border);
}
.rd-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

@media (max-width: 720px) {
  .rd-item {
    grid-template-columns: 1fr;
  }
  .rd-target-row {
    grid-template-columns: 1fr;
  }
  .rd-daterange-pop {
    right: auto;
    left: 0;
  }
  .rd-stats-actions {
    width: 100%;
    justify-content: stretch;
  }
  .rd-daterange,
  .rd-daterange-btn,
  #rdRefreshStats {
    flex: 1;
  }
}

.tg-react-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tg-react-row {
  display: grid;
  grid-template-columns: 64px 1fr 72px auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--elevated);
}
.tg-react-row strong {
  font-size: 13px;
}
.tg-react-row .tg-react-status {
  grid-column: 1 / -1;
  margin: 0;
}
.tg-react-emoji {
  text-align: center;
  font-size: 18px;
}
.tg-react-bot-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tg-react-bot-list li {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--elevated);
  font-family: var(--mono);
  font-size: 13px;
}
@media (max-width: 720px) {
  .tg-react-row {
    grid-template-columns: 1fr 72px;
  }
  .tg-react-row strong {
    grid-column: 1 / -1;
  }
}

.cat-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cat-window {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.cat-window-del {
  margin-bottom: 2px;
}
@media (max-width: 720px) {
  .cat-window {
    grid-template-columns: 1fr 1fr;
  }
  .cat-window-del {
    grid-column: 1 / -1;
  }
}
#view-catalogador .grid3 {
  margin-bottom: 0;
}
#view-catalogador .card + .card {
  margin-top: 16px;
}

.ca-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.ca-day {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card, #121820);
  padding: 12px 10px 10px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ca-day h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ca-slot {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--elevated);
  border-radius: 10px;
  padding: 8px;
  color: inherit;
  cursor: pointer;
}
.ca-slot:hover,
.ca-slot.is-editing {
  border-color: var(--gold, #d4a853);
}
.ca-slot strong {
  display: block;
  font-size: 14px;
}
.ca-slot span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.ca-day-add {
  margin-top: auto;
}
.ca-dest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ca-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ca-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--elevated);
}
.ca-item.is-next {
  border-color: var(--gold, #d4a853);
}
.ca-item strong {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 960px) {
  .ca-week {
    grid-template-columns: 1fr;
  }
  .ca-dest {
    grid-template-columns: 1fr;
  }
}


