/* ============================================================
   TrackFinder — estilos do painel (tema escuro · azul/navy)
   Marca: TrackFinder Blue #1F63E6 · Deep Navy · Signal Cyan
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Marca */
  --brand: #1F63E6;               /* TrackFinder Blue */
  --brand-hover: #3A78EE;
  --brand-2: #4FB7E8;             /* Signal Cyan */
  --brand-soft: rgba(31, 99, 230, .16);
  /* Superfícies (dark em camadas) */
  --bg: #0A1729;                  /* fundo da aplicação */
  --bg-2: #0B152A;                /* sidebar / barras */
  --bg-3: #12233F;                /* superfícies internas (botões, pills, hover) */
  --panel: #0F1F39;               /* cards e painéis */
  --card-inset: #0A1729;          /* inputs, trilhos, code boxes */
  --border: #1C3059;
  --border-soft: #16264A;
  /* Texto */
  --text: #E7ECF6;
  --muted: #8A9ABF;
  --muted-2: #5C74A0;
  /* Semânticas */
  --green: #34D399;
  --blue: #2E74F0;
  --amber: #F0A93B;
  --red: #F04E4E;
  --purple: #B98BF0;
  /* Tipografia / raio / sombra */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-btn: 0 6px 18px -6px rgba(31, 99, 230, .6);
  /* Aliases --tf-* do handoff (mesmos valores acima) */
  --tf-bg: var(--bg); --tf-surface: var(--bg-2); --tf-card: var(--panel); --tf-card-inset: var(--card-inset);
  --tf-border: var(--border); --tf-border-soft: var(--border-soft);
  --tf-primary: var(--brand); --tf-primary-hover: var(--brand-hover); --tf-primary-2: var(--blue); --tf-accent: var(--brand-2);
  --tf-text: var(--text); --tf-text-muted: var(--muted); --tf-text-faint: var(--muted-2);
  --tf-success: var(--green); --tf-warning: var(--amber); --tf-danger: var(--red); --tf-purple: var(--purple);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .page-title, .auth-title, .brand b, .wordmark { font-family: var(--font-head); }
a { color: var(--brand); text-decoration: none; }

/* ---------- Marca (símbolo + wordmark TrackFinder) ---------- */
.logo-mark { display: inline-flex; flex-shrink: 0; }
.logo-mark svg { display: block; }
.wordmark { font-family: var(--font-head); font-weight: 700; letter-spacing: -.4px; }
.wordmark span { color: var(--brand-2); }
.hidden { display: none !important; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #26406F; background: var(--bg-3); color: #C4D0E6;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: .15s;
}
.btn:hover { border-color: var(--blue); color: #fff; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; padding: 11px 18px; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); filter: none; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.btn-danger:hover { filter: brightness(1.1); border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12px; box-shadow: none; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border-color: transparent; color: var(--muted); }
.btn-icon:hover { background: var(--bg-3); color: var(--text); }

/* ---------- Inputs ---------- */
input, select, textarea {
  width: 100%; background: var(--card-inset); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 13px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }

/* Toggle (switch) */
.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; padding: 0; }
.switch .slider { width: 42px; height: 24px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border);
  transition: background .18s, border-color .18s; }
.switch .slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #8A9ABF; transition: transform .18s, background .18s; }
.switch input:checked + .slider { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(46,116,240,.35); }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 400; }

/* ---- Aba Config: seções em 2 colunas ---- */
.panel.cfg-section { display: grid; grid-template-columns: 290px 1fr; gap: 32px; }
.cfg-head h3 { margin: 0 0 5px; font-size: 16px; }
.cfg-head p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cfg-body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cfg-body .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.cfg-body .hint { font-size: 12px; color: var(--muted-2); margin: 6px 0 0; }
.cfg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cfg-body select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-repeat: no-repeat; background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A9ABF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.panel.cfg-danger { border-color: rgba(240,78,78,.3); background: rgba(240,78,78,.035); }
.cfg-danger .cfg-head h3 { color: #F5837F; }
.btn-trash { background: rgba(240,78,78,.12); color: #F5837F; border: 1px solid rgba(240,78,78,.35); }
.btn-trash:hover { background: rgba(240,78,78,.2); border-color: rgba(240,78,78,.5); color: #F5837F; }
@media (max-width: 760px) { .panel.cfg-section { grid-template-columns: 1fr; gap: 16px; } .cfg-grid2 { grid-template-columns: 1fr; } }
textarea { resize: vertical; min-height: 70px; }

/* ============================================================
   AUTH (login / cadastro)
   ============================================================ */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(124,58,237,.25), transparent), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo-badge {
  width: 44px; height: 44px; border-radius: 11px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px;
}
.auth-title { font-weight: 800; font-size: 18px; }
.auth-sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; background: transparent; border: none; color: var(--muted); padding: 8px; border-radius: 8px;
       cursor: pointer; font-weight: 600; font-size: 13px; }
.tab.active { background: var(--brand); color: #fff; }
.auth-form label:first-child { margin-top: 0; }
.auth-form .btn { margin-top: 18px; }
.form-msg { font-size: 12px; margin-top: 10px; min-height: 14px; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--green); }
.auth-hint { text-align: center; font-size: 12px; color: var(--muted-2); margin-top: 18px; }

/* ============================================================
   LAYOUT DO PAINEL
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 220px; background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px; }
.sidebar .brand .logo-badge { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
.sidebar .brand b { font-size: 15px; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 9px 12px;
  border-radius: 9px; font-size: 14.5px; font-weight: 500; margin-bottom: 2px;
}
.nav a .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; text-align: center; opacity: .85; }
.nav a .ico svg { width: 20px; height: 20px; display: block; }
.nav a:hover { background: rgba(255,255,255,.045); color: #DCE4F2; }
.nav a:hover .ico { color: #8FB3FA; opacity: 1; }
.nav a.active { background: linear-gradient(90deg, #1F63E6, #2E74F0); color: #fff; box-shadow: var(--shadow-btn); }
.nav a.active .ico { color: #fff; opacity: 1; }

/* ---- Main ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 72px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center;
  gap: 14px; padding: 0 24px; background: rgba(10,23,41,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar .project-switch { position: relative; }
.topbar .project-switch > button { display: flex; align-items: center; gap: 8px; }
.dropdown {
  position: absolute; top: 110%; left: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; min-width: 220px; padding: 6px; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; background: transparent; border: none; color: var(--text);
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-3); }
.dropdown .sep { border-top: 1px solid var(--border); margin: 6px 0; }
.spacer { flex: 1; }
.plan-badge {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  padding: 5px 13px; border-radius: 999px;
  background: transparent; color: #C4D0E6; border: 1px solid rgba(196,208,230,.34);
}
.tk-pill {
  display: flex; align-items: center; gap: 7px; background: var(--brand-soft); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.tk-pill .ico { color: var(--brand); display: inline-flex; align-items: center; }
.tk-pill .ico svg { display: block; }
.tk-pill .tk-label { font-weight: 500; color: rgba(214,224,244,.62); }
.topbar .btn-primary { height: 44px; padding-top: 0; padding-bottom: 0; }

/* Banner de saldo baixo (aviso na plataforma) */
.low-bal-banner { display: flex; align-items: center; gap: 12px; margin: 16px 24px 0;
  background: rgba(240,169,59,.12); border: 1px solid rgba(240,169,59,.35); border-radius: 12px;
  padding: 12px 16px; font-size: 13.5px; color: #F0A93B; }
.low-bal-banner span { flex: 1; }
.low-bal-banner b { color: #F5C066; }
.low-bal-banner .lbb-ico { flex: 0 0 auto; font-size: 16px; }
.low-bal-banner .btn { flex: 0 0 auto; }
.low-bal-banner.hidden { display: none; }

/* Onboarding — checklist "Primeiros passos" */
.onb-card { background: linear-gradient(180deg, rgba(46,116,240,.09), transparent), var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 16px; }
.onb-card.onb-done { background: linear-gradient(180deg, rgba(52,211,153,.10), transparent), var(--panel); }
.onb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.onb-title { font-family: var(--font-head); font-size: 17px; margin: 0 0 2px; }
.onb-sub { color: var(--muted); font-size: 13px; margin: 0; }
.onb-hide { background: transparent; border: none; color: var(--muted-2); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 4px; flex: 0 0 auto; }
.onb-hide:hover { color: var(--text); }
.onb-bar { height: 7px; background: var(--card-inset); border-radius: 5px; overflow: hidden; margin: 16px 0 6px; }
.onb-bar-fill { height: 100%; background: linear-gradient(90deg, #1F63E6, #4FB7E8); border-radius: 5px; transition: width .3s; }
.onb-count { font-size: 12px; color: var(--muted-2); margin-bottom: 12px; }
.onb-steps { display: flex; flex-direction: column; gap: 8px; }
.onb-step { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--card-inset); }
.onb-step.done { opacity: .72; }
.onb-check { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border); color: transparent; }
.onb-step.done .onb-check { background: var(--green); border-color: var(--green); color: #0A1729; }
.onb-step-txt { flex: 1; min-width: 0; }
.onb-step-txt b { display: block; font-size: 14px; }
.onb-step-txt span { font-size: 12.5px; color: var(--muted); }
.onb-step .btn { flex: 0 0 auto; }
.onb-tag { flex: 0 0 auto; font-size: 11.5px; color: var(--green); font-weight: 600; }

/* Integração — painel principal destacado + badge */
.panel.panel-accent { border-color: #2E74F0; box-shadow: 0 0 0 1px rgba(46,116,240,.35), 0 18px 50px -30px rgba(46,116,240,.5); }
.int-badge { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--green); background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); padding: 4px 11px; border-radius: 20px; margin-bottom: 10px; }

/* Suporte — botão WhatsApp */
.sup-wpp { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.btn-wpp { display: inline-flex; align-items: center; gap: 8px; background: #25D366; border-color: #25D366; color: #fff; text-decoration: none; font-weight: 600; }
.btn-wpp:hover { background: #1EBE5A; border-color: #1EBE5A; color: #fff; filter: none; }
.btn-wpp svg { flex: 0 0 auto; }

.content { padding: 24px; max-width: 1100px; width: 100%; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }

/* ---- Cards / grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em; margin-top: 9px; }
.stat .v.v-blue { color: #8FB3FA; }
.stat .v.v-green { color: var(--green); }
.stat .v.v-accent { color: #4FB7E8; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 18px;
}
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel .desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ---- Tabela ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted-2); font-weight: 600; padding: 12px; border-bottom: 1px solid var(--border-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 14px 12px; border-bottom: 1px solid #12213e; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.025); cursor: pointer; }
.empty { text-align: center; color: var(--muted-2); padding: 30px; }

/* ---- Badges de status ---- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.st-pending { background: rgba(138,154,191,.16); color: #B9C4DD; }
.st-separation, .st-verification, .st-packaging { background: rgba(240,169,59,.14); color: #F0A93B; }
.st-dispatched, .st-in_transit { background: rgba(46,116,240,.16); color: #7FB0F5; }
.st-out_for_delivery { background: rgba(185,139,240,.16); color: #B98BF0; }
.st-delivered { background: rgba(52,211,153,.15); color: #34D399; }

/* ---- Pill-select de status inline na tabela ---- */
.status-inline {
  appearance: none; -webkit-appearance: none;
  width: auto; min-width: 150px; cursor: pointer; outline: none;
  border-radius: 8px; padding: 6px 28px 6px 11px;
  font-family: var(--font-body, 'IBM Plex Sans', sans-serif); font-weight: 600; font-size: 12.5px;
  border: 1px solid transparent; background-color: transparent;
  background-repeat: no-repeat; background-position: right 9px center;
}
.status-inline.st-pending { color: #7FB0F5; background-color: rgba(46,116,240,.12); border-color: rgba(46,116,240,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237FB0F5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline.st-separation { color: #F0A93B; background-color: rgba(240,169,59,.12); border-color: rgba(240,169,59,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23F0A93B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline.st-verification, .status-inline.st-packaging { color: #E0A24A; background-color: rgba(224,162,74,.12); border-color: rgba(224,162,74,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E0A24A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline.st-dispatched, .status-inline.st-in_transit { color: #7FB0F5; background-color: rgba(46,116,240,.12); border-color: rgba(46,116,240,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237FB0F5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline.st-out_for_delivery { color: #B98BF0; background-color: rgba(185,139,240,.12); border-color: rgba(185,139,240,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B98BF0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline.st-delivered { color: #34D399; background-color: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2334D399' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-inline option { background: var(--panel); color: var(--text); }

/* ---- Celulas da tabela de Pedidos ---- */
.ord-code { font-family: var(--font-mono); font-size: 12px; color: #C4D0E6; white-space: nowrap; }
.cust-name { display: block; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.cust-mail { display: block; font-size: 12px; color: #6C82AA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.seen-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #34D399; background: rgba(52,211,153,.12); }
.seen-pill.seen-no { color: var(--muted-2); background: rgba(92,116,160,.1); font-weight: 500; }
.seen-pill svg { flex: 0 0 auto; }
/* Variáveis do editor de e-mail (clique insere no cursor) */
.crm-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.crm-vars-lbl { font-size: 11.5px; color: var(--muted-2); margin-right: 2px; }
.crm-var { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(124,58,237,.08); color: #A78BFA; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; cursor: pointer; transition: background .15s, border-color .15s; }
.crm-var:hover { background: rgba(124,58,237,.18); border-color: #7C3AED; }

/* Fluxo pausado (rastreio ou marketing) de um cliente específico */
.paused-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: #FBBF24; background: rgba(251,191,36,.12); white-space: nowrap; }
.flow-paused-box { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid rgba(251,191,36,.35); border-left: 3px solid #FBBF24; border-radius: 8px; background: rgba(251,191,36,.07); }
.flow-paused-box b { color: #FBBF24; font-size: 13.5px; }
.flow-paused-box span { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.mail-cell { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; }
.mail-cell svg { color: #6C82AA; flex: 0 0 auto; }
.plat-tag { font-family: var(--font-mono); font-size: 11px; color: #8FB3FA; background: rgba(46,116,240,.1); border: 1px solid rgba(46,116,240,.22); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.col-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; line-height: 1.4; }
.orders-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--muted-2); }
.orders-foot b { font-family: var(--font-head); color: #C4D0E6; font-weight: 600; }
/* Paginação de pedidos */
.pg { display: flex; align-items: center; gap: 6px; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid #26406F; background: transparent;
  color: #C4D0E6; font-family: var(--font-head); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .13s, background .13s, color .13s; }
.pg-btn:hover:not(:disabled) { border-color: var(--blue); color: #fff; }
.pg-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-btn.pg-arrow { color: #6C82AA; }
.pg-btn.pg-arrow:hover:not(:disabled) { color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-ell { color: var(--muted-2); padding: 0 2px; }

/* ---- Code blocks / copy ---- */
.code-block {
  position: relative; background: #0a0e18; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 14px; font-family: var(--font-mono); font-size: 12px;
  color: #cdd5e6; overflow-x: auto; white-space: pre; line-height: 1.6;
}
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 4px 4px 4px 12px; }
.copy-row input { border: none; background: transparent; padding: 8px 0; font-family: var(--font-mono); font-size: 12px; }
.copy-row .btn { flex-shrink: 0; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }

/* ---- Tabs (integração / simulador / código) ---- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.subtab { background: transparent; border: none; color: var(--muted); padding: 9px 12px; cursor: pointer;
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.subtab.active { color: #fff; border-bottom-color: var(--brand); }

/* ---- Toggle / accordion ---- */
.accordion { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.accordion > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex;
  align-items: center; gap: 10px; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion[open] > summary { border-bottom: 1px solid var(--border); }
.accordion .acc-body { padding: 16px; }

/* ---- Platform cards ---- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.plat-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px;
}
.plat-card:hover { border-color: var(--brand); }
.plat-logo { width: 30px; height: 30px; border-radius: 7px; background: var(--brand-soft); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }

/* ---- Steps "3 passos" ---- */
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; }
.step3 { background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.step3 .num { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px; }
.step3 b { display: block; margin-bottom: 4px; }
.step3 p { margin: 0; color: var(--muted); font-size: 12px; }

/* ---- Planos ---- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 24px; position: relative; }
.plan-card.featured { border-color: #2E74F0; box-shadow: 0 0 0 1px #2E74F0, 0 18px 50px -20px rgba(46,116,240,.7); }
.plan-card h4 { font-family: var(--font-head); margin: 0; font-size: 19px; font-weight: 600; color: #fff; }
.plan-price { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-head); font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 0; color: #fff; }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-chip { align-self: flex-start; margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: #4FB7E8; background: rgba(79,183,232,.1); border: 1px solid rgba(79,183,232,.22); padding: 5px 11px; border-radius: 8px; }
.plan-feats { list-style: none; padding: 0; margin: 22px 0 24px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.plan-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.45; color: #C4D0E6; }
.plan-feats li::before { content: none; }
.plan-feats li svg { color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.btn-current { background: transparent; color: #8FB3FA; border: 1px solid #2E5089; }
.btn-current:hover { background: transparent; border-color: #3A78EE; color: #fff; }
.btn-current[disabled] { opacity: .75; cursor: default; }

/* Banner "plano atual" */
.plan-current { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 18px 24px; background: linear-gradient(90deg, #0F1F39, #12234a); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px; }
.plan-current .pc-block { display: flex; align-items: center; gap: 14px; }
.pc-badge { width: 38px; height: 38px; border-radius: 10px; background: rgba(52,211,153,.12); color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pc-label { font-size: 12px; color: var(--muted); }
.pc-value { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--green); text-transform: uppercase; }
.pc-divider { width: 1px; height: 34px; background: var(--border); }
.pc-saldo { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 1px; }
.pc-saldo svg { color: #4FB7E8; }
.pc-saldo b { font-family: var(--font-head); font-size: 16px; color: #fff; font-weight: 600; }

/* Banner de créditos avulsos */
.plans-avulso { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 26px; margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 50% 0%, #12234a 0%, #0F1F39 60%); }
.plans-avulso p { font-size: 14.5px; line-height: 1.6; color: #C4D0E6; max-width: 640px; margin: 0; }
.plans-avulso b { color: #fff; }

/* ---- Toast / modal ---- */
.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--green); border-radius: 10px; padding: 12px 16px; font-size: 13px; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 340px;
}
.toast.error { border-left-color: var(--red); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center;
  justify-content: center; z-index: 60; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---- Timeline detalhe (painel) ---- */
.tl { margin-top: 10px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-top: 4px; flex-shrink: 0; }
.tl-item .tl-line { position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child .tl-line { display: none; }
.tl-body b { font-size: 13px; }
.tl-body span { display: block; color: var(--muted); font-size: 12px; }

/* ---- Misc ---- */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.filters { display: flex; gap: 12px; flex-wrap: nowrap; margin-bottom: 18px; align-items: center; }
.filters > * { flex: 0 0 auto; }
.filters .grow { flex: 1 1 160px; min-width: 0; }
.filters select {
  appearance: none; -webkit-appearance: none; flex: 0 0 200px; width: 200px; padding-right: 34px;
  background-repeat: no-repeat; background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A9ABF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.filters input[type="date"] { flex: 0 0 170px; width: 170px; }
.filters input[type="search"] {
  padding-left: 38px;
  background-repeat: no-repeat; background-position: left 13px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%235C74A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 2px; }

/* Compra de TK (grade de opções) */
.tk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tk-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; }
.tk-opt b { font-size: 15px; }
.tk-opt span { color: var(--muted); font-size: 12px; }
.tk-opt:hover { border-color: var(--brand); }
.tk-opt.active { border-color: var(--brand); background: rgba(31,99,230,.12); }

/* ---- Modal Comprar Tracks / Meus Pedidos ---- */
.tk-ov { background: rgba(7,15,30,.6); backdrop-filter: blur(3px); }
.tkm { width: 520px; max-width: calc(100vw - 24px); background: #0E1D38; border: 1px solid #22375f; border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(46,116,240,.06); }
.tkm-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #1A2C4D; }
.tkm-seg { display: flex; gap: 2px; background: var(--card-inset); border: 1px solid var(--border); border-radius: 11px; padding: 4px; }
.tkm-tab { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: var(--muted); border-radius: 8px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; transition: background .13s, color .13s; }
.tkm-tab.active { background: var(--brand); color: #fff; }
.tkm-tab svg { flex: 0 0 auto; }
.tkm-x { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid #26406F; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tkm-x:hover { color: #fff; border-color: var(--blue); }
.tkm-body { padding: 20px 18px 18px; }
.tkm-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin: 0 0 6px; color: #fff; }
.tkm-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.tkm-sub .acc { color: #4FB7E8; font-weight: 600; }
.tkm-sub b { color: #C4D0E6; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkg { position: relative; text-align: left; background: var(--card-inset); border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px;
  cursor: pointer; color: var(--text); transition: border-color .13s, transform .13s, background .13s, box-shadow .13s; }
.pkg:hover { border-color: #2E5089; transform: translateY(-1px); }
.pkg b { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: #fff; display: block; }
.pkg .pkg-sub { font-size: 12px; color: var(--muted); }
.pkg .tick { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); color: #fff;
  display: none; align-items: center; justify-content: center; }
.pkg.sel { border-color: #2E74F0; background: linear-gradient(160deg, rgba(46,116,240,.14), rgba(15,31,57,.4)); box-shadow: 0 0 0 1px #2E74F0; }
.pkg.sel .tick { display: inline-flex; }
.pkg-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--card-inset); border: 1px solid #2E74F0; border-radius: 12px; padding: 12px 14px; }
.pkg-custom span { font-size: 13px; color: var(--muted); }
.pkg-custom input { flex: 1; min-width: 0; width: auto; background: transparent; border: none; color: #fff; font-family: var(--font-head); font-size: 16px; font-weight: 700; padding: 0; }
.pkg-custom input:focus { outline: none; }
.tk-total { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; background: var(--card-inset); border: 1px dashed #26406F; border-radius: 12px; padding: 14px 16px; }
.tk-total-l { display: flex; align-items: center; gap: 10px; color: #C4D0E6; font-size: 14px; }
.tk-total-l svg { color: #4FB7E8; flex: 0 0 auto; }
.tk-total-l b { font-family: var(--font-head); color: #fff; }
.tk-total-r { text-align: right; }
.tk-total-r b { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #fff; }
.tk-total-r span { display: block; font-size: 11px; color: var(--muted); }
.btn-genpix { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 16px; background: var(--brand);
  border: none; color: #fff; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s; }
.btn-genpix:hover { background: var(--brand-hover); }
.btn-genpix:disabled { opacity: .7; cursor: default; }
.ord-scroll { display: flex; flex-direction: column; gap: 9px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.ord-scroll::-webkit-scrollbar { width: 8px; }
.ord-scroll::-webkit-scrollbar-thumb { background: #22375f; border-radius: 8px; }
.ordrow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; background: var(--card-inset); border: 1px solid #15264a; }
.ord-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ord-ico.track { background: rgba(79,183,232,.12); color: #4FB7E8; }
.ord-ico.plan { background: rgba(140,90,220,.12); color: #B98BF0; }
.ord-mid { flex: 1; min-width: 0; }
.ord-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text); }
.ord-date { font-family: var(--font-mono); font-size: 11.5px; color: #7E8CA8; margin-top: 2px; }
.ord-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ord-pill { font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.ord-pill.paid { color: #34D399; background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); }
.ord-pill.pending { color: #F0A93B; background: rgba(240,169,59,.12); border: 1px solid rgba(240,169,59,.3); }
.ord-pill.exp { color: var(--muted-2); background: rgba(92,116,160,.1); border: 1px solid rgba(92,116,160,.25); }
.btn-reopen { background: transparent; border: 1px solid #26406F; color: #C4D0E6; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-reopen:hover { border-color: var(--blue); color: #fff; }
.plan-card.current { outline: 2px solid var(--brand); }
.plan-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: linear-gradient(90deg, #1F63E6, #2E74F0); color: #fff; font-size: 11px; font-weight: 600; padding: 5px 14px; border-radius: 20px; box-shadow: 0 6px 16px -4px rgba(31,99,230,.7); }
.plan-tag.plan-tag-current { background: linear-gradient(90deg, #16a34a, #34D399); box-shadow: 0 6px 16px -4px rgba(52,211,153,.6); }
.plan-card { position: relative; }

/* Menu do usuário (avatar + dropdown) no topo */
.user-menu { position: relative; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.user-avatar:hover { filter: brightness(1.12); }
.user-menu:has(.user-dropdown:not(.hidden)) .user-avatar { outline: 2px solid #4FB7E8; outline-offset: 2px; }

/* ---- Menu do usuário (popup do avatar) ---- */
.user-dropdown { position: absolute; right: 0; left: auto; top: calc(100% + 12px); width: 300px; max-width: calc(100vw - 24px);
  background: #0E1D38; border: 1px solid #22375f; border-radius: 16px; overflow: hidden; padding: 0; z-index: 60;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(46,116,240,.08); }
.user-dropdown.hidden { display: none; }
.um-head { display: flex; align-items: center; gap: 13px; padding: 18px 18px 16px; }
.um-av { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg,#2E74F0,#4FB7E8); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 19px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.um-id { min-width: 0; flex: 1; }
.um-name { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-mail { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-pro { align-self: flex-start; flex: 0 0 auto; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  color: #4FB7E8; border: 1px solid #21506e; border-radius: 20px; padding: 3px 8px; }
.um-balance { margin: 0 14px 14px; border-radius: 12px; padding: 13px 14px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, rgba(46,116,240,.16), rgba(79,183,232,.1)); border: 1px solid rgba(79,183,232,.24); }
.um-bal-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(79,183,232,.15); color: #4FB7E8;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.um-bal-txt { flex: 1; min-width: 0; }
.um-bal-txt b { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: #fff; }
.um-bal-unit { font-size: 12px; color: var(--muted); }
.um-bal-sub { font-size: 11.5px; color: #7E8CA8; margin-top: 1px; }
.um-buy { flex: 0 0 auto; background: var(--brand); border: none; color: #fff; border-radius: 8px; padding: 8px 12px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.um-buy:hover { background: var(--brand-hover); }
.um-meta { padding: 0 18px 6px; display: flex; flex-direction: column; gap: 9px; }
.um-meta > div { display: flex; align-items: center; justify-content: space-between; }
.um-meta .k { font-size: 13px; color: var(--muted); }
.um-meta b { font-size: 13px; font-weight: 600; color: var(--text); }
.um-role { font-size: 12px; font-weight: 600; color: #B98BF0; background: rgba(140,90,220,.14);
  border: 1px solid rgba(140,90,220,.3); padding: 2px 9px; border-radius: 20px; }
.um-sep { height: 1px; background: #1A2C4D; }
.um-sep.top { margin: 14px 14px 8px; }
.um-sep.bot { margin: 6px 14px 8px; }
.um-actions { padding: 0 8px 6px; display: flex; flex-direction: column; }
.um-logout { padding: 0 8px 12px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: #C4D0E6; font-family: inherit; font-weight: 500; font-size: 14px; background: none; border: none; width: 100%; text-align: left;
  transition: background .13s, color .13s; }
.mrow:hover { background: rgba(255,255,255,.05); color: #fff; }
.mrow .ico { color: #6C82AA; flex: 0 0 auto; display: inline-flex; }
.mrow:hover .ico { color: #8FB3FA; }
.mrow .chev { margin-left: auto; flex: 0 0 auto; color: #3E5175; display: inline-flex; transition: transform .13s, color .13s; }
.mrow:hover .chev { color: #6C82AA; transform: translateX(2px); }
.mrow.danger { color: #F0837F; }
.mrow.danger .ico { color: #F0837F; }
.mrow.danger:hover { background: rgba(240,78,78,.1); color: #F5A6A3; }
.mrow.danger:hover .ico { color: #F0837F; }

/* Logística Reversa: linha de configuração (rótulo à esquerda, controle à direita) */
.rl-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.rl-line:last-of-type { border-bottom: none; }
.rl-line select { max-width: 200px; }
.rl-line > div:first-child { flex: 1; }
.btn-block { display: block; width: 100%; }

@media (max-width: 760px) {
  .sidebar { display: none; }
}

/* ============================================================
   Polish global — transições e animações suaves ("fluido")
   ============================================================ */
@keyframes tf-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes tf-spin { to { transform: rotate(360deg); } }

/* Entrada suave dos blocos ao trocar de página */
.content .page-title, .content .page-sub, .content .panel, .content .plans,
.content .tabs, .content .cards, .content > .row { animation: tf-fade-up .34s cubic-bezier(.2,.7,.2,1) both; }

/* Transições macias em elementos interativos */
.btn, .btn-icon, .btn-sm { transition: transform .16s cubic-bezier(.2,.7,.2,1), background .16s, border-color .16s, box-shadow .16s, filter .16s, opacity .16s; }
.btn:hover, .btn-sm:hover { transform: translateY(-1px); }
.btn:active, .btn-sm:active, .btn-icon:active { transform: translateY(0) scale(.97); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(31,99,230,.35); }

input, select, textarea { transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(31,99,230,.16); }

.panel { transition: border-color .2s, box-shadow .2s, transform .2s; }
.stat, .plan-card, .tk-opt { transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s, background .2s; }
.stat:hover { transform: translateY(-3px); border-color: var(--brand); }
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.32); }
.badge, .tag { transition: background .15s, color .15s; }

/* Navegação lateral mais macia */
#nav a { transition: background .16s, color .16s, transform .12s; }
#nav a:hover { transform: translateX(2px); }

/* Dropdowns e menus */
.dropdown:not(.hidden), .user-dropdown:not(.hidden), .project-switch .dropdown:not(.hidden) { animation: tf-fade-up .16s ease both; }

/* Modais: overlay com blur + card entrando suave */
.modal-overlay { animation: tf-fade .18s ease both; backdrop-filter: blur(3px); }
.modal { animation: tf-modal-in .24s cubic-bezier(.2,.7,.2,1) both; }

/* Toast entrando */
.toast { animation: tf-fade-up .22s cubic-bezier(.2,.7,.2,1) both; }

/* Estado de carregamento com spinner */
.empty { animation: tf-fade .3s ease both; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: tf-spin .7s linear infinite; vertical-align: middle; }

/* Scrollbar discreta (WebKit) */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2e4472; background-clip: padding-box; }

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Sininho (badge de notificação) ---------- */
.btn-icon.bell { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: #e24b4a; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg-2);
}
.bell-badge.hidden { display: none; }

/* ---------- Chat de suporte ---------- */
.sup-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 52vh; overflow-y: auto; padding: 6px 4px 10px;
}
.sup-msg { max-width: 78%; display: flex; flex-direction: column; }
.sup-msg.mine { align-self: flex-end; align-items: flex-end; }
.sup-msg.them { align-self: flex-start; align-items: flex-start; }
.sup-b {
  padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  word-break: break-word; white-space: normal;
}
.sup-msg.mine .sup-b { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.sup-msg.them .sup-b { background: var(--bg-3); color: var(--text); border-bottom-left-radius: 4px; }
.sup-t { font-size: 11px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.sup-compose {
  display: flex; gap: 8px; align-items: flex-end;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.sup-compose textarea { flex: 1; resize: vertical; min-height: 44px; }
.sup-compose .btn { white-space: nowrap; }

/* Badge "em breve" nos cards de plataforma */
.soon-badge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; background: var(--bg-3); color: var(--muted);
  vertical-align: middle; text-transform: uppercase; letter-spacing: .3px;
}
.plat-card.soon { opacity: .6; }
.plat-card.soon:hover { opacity: .85; }

/* Lista de conversas (admin) */
.sup-list { display: flex; flex-direction: column; gap: 8px; }
.sup-conv {
  text-align: left; width: 100%; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); transition: border-color .15s;
}
.sup-conv:hover { border-color: var(--brand); }
.sup-conv-top { display: flex; align-items: center; gap: 8px; }
.sup-last { margin-top: 4px; font-style: italic; }

/* ============================================================
   CRM & E-mail marketing
   ============================================================ */
.crm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; }
.crm-tab { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.crm-tab:hover { color: var(--text); background: var(--bg-3); }
.crm-tab.active { color: #fff; background: var(--brand); border-color: var(--brand); }

.crm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.crm-stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.crm-stat .v { font-size: 26px; font-weight: 700; color: var(--text); }
.crm-stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.crm-stat.ok .v { color: #34D399; } .crm-stat.warn .v { color: #FBBF24; } .crm-stat.muted .v { color: var(--muted); }

.crm-alert { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); color: #FCD34D; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; }
.crm-alert a { color: #FCD34D; text-decoration: underline; }

.crm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.crm-toolbar > .muted { flex: 1; }
.crm-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.crm-fbtn { background: var(--bg-3); border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer; }
.crm-fbtn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }
.crm-search { flex: 1 1 220px; min-width: 0; background: var(--card-inset); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.crm-toolbar-actions { display: flex; gap: 8px; margin-left: auto; }

.crm-tablewrap { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); }
.crm-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: middle; }
.crm-table tr:last-child td { border-bottom: none; }
.crm-mail { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; color: var(--brand-2); }
.crm-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.crm-total { margin-top: 10px; font-size: 12px; }

.crm-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg-3); color: var(--muted); border: 1px solid var(--border); }
.crm-badge.ok { background: rgba(52,211,153,.14); color: #34D399; border-color: rgba(52,211,153,.3); }
.crm-badge.warn { background: rgba(251,191,36,.14); color: #FBBF24; border-color: rgba(251,191,36,.3); }
.crm-badge.danger { background: rgba(248,113,113,.14); color: #F87171; border-color: rgba(248,113,113,.3); }
.crm-badge.muted { color: var(--muted); }

.crm-funnel { margin-bottom: 14px; }
.crm-funnel-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.crm-funnel-h b { font-size: 15px; margin-right: 8px; }
.crm-funnel-actions { display: flex; align-items: center; gap: 8px; }
.crm-steps { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.crm-step { display: flex; align-items: center; gap: 12px; background: var(--card-inset); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 12px; }
.crm-step-n { width: 24px; height: 24px; flex-shrink: 0; border-radius: 999px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.crm-step-body { flex: 1; min-width: 0; }
.crm-step-when { font-size: 11.5px; color: var(--muted); }
.crm-step-subj { font-size: 13.5px; color: var(--text); font-weight: 500; }
.crm-step-actions { display: flex; gap: 6px; }
.crm-addstep { margin-top: 4px; }

.crm-tpl { margin-bottom: 10px; }
.crm-tpl-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crm-tpl-h > div { display: flex; gap: 6px; }
.crm-tpl-subj { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.crm-lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin: 12px 0 5px; }
.crm-inp { width: 100%; background: var(--card-inset); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 9px 12px; font-size: 13.5px; }
.crm-inp:focus { outline: none; border-color: var(--brand); }
.crm-ta { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.crm-delay-row { display: flex; gap: 10px; }
.crm-delay-row .crm-lbl { flex: 1; }
.crm-err { font-size: 11px; color: #F87171; margin-top: 2px; }

.crm-modal-ov { position: fixed; inset: 0; background: rgba(5,10,20,.62); backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.crm-modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.crm-modal.wide { max-width: 1040px; }
/* Editor de e-mail: mais largo, porque são 2 colunas (form + prévia) e cada uma
   precisa ficar maior que a caixa antiga de 560px. */
.crm-modal.xwide { max-width: 1320px; }
.crm-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.crm-split-form { min-width: 0; }
.crm-split-prev { min-width: 0; display: flex; flex-direction: column; position: sticky; top: 0; }
.crm-prev-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 22px; }
.crm-prev-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }
.crm-prev-subj { font-size: 13px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-prev-frame { width: 100%; height: 460px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.crm-prev-note { margin-top: 8px; font-size: 11.5px; color: var(--muted-2); line-height: 1.45; }
/* Caixa de HTML acompanha a altura da prévia (some a barra de rolagem dupla). */
.crm-split .crm-ta { min-height: 300px; }
@media (max-width: 1100px) {
  .crm-split { grid-template-columns: 1fr; }
  .crm-split-prev { position: static; }
  .crm-prev-frame { height: 320px; }
}
.crm-modal.wide .crm-table th, .crm-modal.wide .crm-table td { white-space: nowrap; }
.crm-modal.wide .crm-table td:nth-child(6) { white-space: normal; min-width: 160px; }
.crm-modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.crm-modal-h b { font-size: 15px; }
.crm-modal-x { background: transparent; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.crm-modal-x:hover { color: var(--text); }
.crm-modal-b { padding: 18px 20px 20px; }
.crm-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
