/* Admin > E-mails (Sprint 14). Cores da marca vêm do theme.css (--bd-primary etc.). */
/* Rodada menu + E-mails (07/10/2026): E-mails é aba de Settings e segue o visual dele (abas
   .bd-tabbtn, cartão .bd-panel, tabela .bd-table, selo .bd-tag, botão .btn-primary).
   As classes .em-* são as que o emails.js monta; o acabamento da rodada única (14/10/2026) tirou
   as que não tinham uso (.em-head, .em-tabs, .em-st, .btn-brand) e os style= do emails.js. */
.em-page { max-width: none; }
.em-section-head { margin-bottom: 1rem; }

.em-card { background:#fff; border:1px solid var(--bd-border); border-radius:6px; padding:1rem; margin-bottom:1rem; box-shadow:none; }
/* Cabeçalho do cartão como em Settings: título em negrito, frase cinza embaixo, ações à direita. */
.em-card-h { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:.75rem; row-gap:.15rem; align-items:start; padding:0; border-bottom:0; }
.em-card-h h3 { grid-column:1; grid-row:1; margin:0; font-size:.95rem; font-weight:700; }
.em-card-h .note { grid-column:1; grid-row:2; color:var(--bd-muted); font-size:.78rem; }
.em-card-h > :not(h3):not(.note) { grid-column:2; grid-row:1 / span 2; justify-self:end; }
.em-card-b { padding:0; }
.em-card-h + .em-card-b, .em-card-h + .table-responsive, .em-card-h + div { margin-top:1rem; }
.em-row2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.em-row3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
@media (max-width: 991px) { .em-row2, .em-row3 { grid-template-columns:1fr; } }

.em-f { margin-bottom:14px; }
.em-f label { display:block; font-weight:600; font-size:.84rem; margin-bottom:4px; color:#0f172a; }
.em-help { color:#64748b; font-size:.8rem; margin-top:4px; }
.em-err { color:#b42318; font-size:.8rem; margin-top:4px; }
.em-ok-line { color:#067647; font-size:.84rem; }
.em-sep { border-top:1px solid #eef0f4; margin:16px 0; }

/* S6.6: selos com o visual de .bd-tag (sem borda, peso 500, raio 4px, tons do theme.css). */
.em-chip { display:inline-flex; align-items:center; gap:.3rem; font-weight:500; font-size:.75rem; line-height:1.4; border-radius:4px; padding:.15rem .5rem; border:0; white-space:nowrap; color:var(--bd-neutro-fg,#475569); background:var(--bd-neutro-bg,#f1f5f9); }
.em-chip.enviando { color:var(--bd-ok-fg,#047857); background:var(--bd-ok-bg,#ecfdf5); }
.em-chip.teste { color:var(--bd-info-fg,#1d4ed8); background:var(--bd-info-bg,#eff6ff); }
.em-chip.pausado { color:var(--bd-neutro-fg,#475569); background:var(--bd-neutro-bg,#f1f5f9); }
.em-chip.pausado_sistema, .em-chip.maquina { color:var(--bd-fail-fg,#b91c1c); background:var(--bd-fail-bg,#fef2f2); }
.em-tag { display:inline-block; font-size:.72rem; font-weight:600; border-radius:4px; padding:2px 9px; border:1px solid #e2e8f0; color:#475569; background:#fff; white-space:nowrap; }
.em-tag.brand { border-color:var(--bd-primary-200,#dddcf7); color:var(--bd-primary,#726bc2); background:var(--bd-primary-100,#f1f0fc); }

.em-block { border:1px solid var(--bd-border); border-radius:6px; padding:1rem; }
.em-block .lbl { color:#64748b; font-size:.8rem; }
.em-block .val { font-weight:700; font-size:1rem; margin:4px 0 10px; }

.em-banner { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:0; }
.em-banner a { margin-left:auto; font-weight:600; text-decoration:none; color:#0f172a; }

/* A2.22 (Sprint 2): as tabelas usam a .bd-table do tema; aqui só o que é desta tela. */
.bd-table input.form-control { max-width:110px; }
.bd-table td.em-motivo { max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--bd-muted); font-size:.8125rem; }
.em-tec > summary { cursor:pointer; font-size:.8125rem; font-weight:500; color:var(--bd-muted); }
.em-tec > summary:hover { color:var(--bd-text); }

.em-pre { white-space:pre-wrap; background:#f8fafc; border:1px solid #eef0f4; border-radius:4px; padding:12px; max-height:460px; overflow:auto; font-family:ui-monospace,Menlo,monospace; font-size:12.5px; }
textarea.em-code { font-family:ui-monospace,Menlo,monospace; font-size:12.5px; min-height:300px; }
.em-vars button { font-family:ui-monospace,Menlo,monospace; font-size:11.5px; margin:0 6px 6px 0; border-radius:4px; border:1px solid var(--bd-primary-200,#dddcf7); background:var(--bd-primary-100,#f1f0fc); color:var(--bd-primary,#5e57a5); padding:2px 10px; }

/* Modelos: 3 colunas */
.em-tpl { display:grid; grid-template-columns:280px minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:start; }
@media (max-width: 1199px) { .em-tpl { grid-template-columns:240px minmax(0,1fr); } .em-tpl > .em-tpl-pv { grid-column:1 / -1; } }
@media (max-width: 767px) { .em-tpl { grid-template-columns:1fr; } }
.em-list { border:1px solid var(--bd-border,#e8e8ef); border-radius:4px; overflow:hidden; background:#fff; max-height:calc(100vh - 220px); overflow-y:auto; }
.em-list button { display:block; width:100%; text-align:left; background:#fff; border:0; border-bottom:1px solid #eef0f4; padding:12px 16px; }
.em-list button:hover { background:#fafafb; }
.em-list button.active { background:var(--bd-primary,#726bc2); color:#fff; }
.em-list button .t { font-weight:600; font-size:.9rem; display:flex; justify-content:space-between; gap:8px; }
.em-list button .s { font-size:.76rem; color:#64748b; }
.em-list button.active .s { color:#e7e5fb; }

/* Prévia */
.em-pv-tabs .btn { font-size:.82rem; }
.em-pv-tabs .btn.active { background:var(--bd-primary,#726bc2); border-color:var(--bd-primary,#726bc2); color:#fff; }
.em-pv-stage { background:#f6f7fb; border:1px solid #eef0f4; border-radius:4px; padding:12px; display:flex; justify-content:center; }
.em-frame { width:100%; height:640px; border:0; background:#f6f7fb; border-radius:4px; }
.em-pv-stage.mobile .em-frame { width:390px; max-width:100%; border:8px solid #0f172a; border-radius:6px; }

/* Automações */
.em-auto-card { display:flex; gap:16px; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; }
.em-auto-card .acts { display:flex; flex-direction:column; gap:8px; min-width:150px; }
.em-steps { position:relative; }
.em-step { border:1px solid #e5e7ef; border-radius:4px; background:#fff; margin-bottom:12px; }
.em-step-h { display:flex; gap:10px; align-items:center; padding:10px 14px; border-bottom:1px solid #f1f3f7; flex-wrap:wrap; }
.em-step-h .kind { font-size:.75rem; font-weight:500; border-radius:4px; padding:.15rem .5rem; }
.em-step.espera .kind { background:#fffbeb; color:#92400e; }
.em-step.pergunta .kind { background:#eff6ff; color:#1d4ed8; }
.em-step.email .kind { background:var(--bd-primary-100,#f1f0fc); color:var(--bd-primary,#5e57a5); }
.em-step-b { padding:12px 14px; }
.em-step .people { margin-left:auto; color:#64748b; font-size:.8rem; }
.em-start { font-size:.82rem; color:#64748b; margin-bottom:8px; }

.em-msg { font-size:.84rem; margin-top:8px; }
.em-msg.ok { color:#067647; } .em-msg.err { color:#b42318; }
.em-warn { border:1px solid #f5d38b; background:#fffbeb; color:#92400e; border-radius:4px; padding:10px 14px; font-size:.86rem; margin-bottom:14px; }
/* Sub-abas de Envios no formato das abas de Settings (.bd-tabbtn, tamanho menor). */
.em-sub { display:flex; gap:.35rem; margin-bottom:1rem; flex-wrap:wrap; }
.em-sub button { border:1px solid var(--bd-border); background:#fff; color:var(--bd-muted); border-radius:4px; padding:.3rem .65rem; font-size:.74rem; font-weight:600; }
.em-sub button:hover { color:var(--bd-primary); border-color:var(--bd-primary); }
.em-sub button.active { background:var(--bd-primary-100); border-color:var(--bd-primary); color:var(--bd-primary); }
/* Medidas que antes iam em style= no emails.js. */
.em-fs-86 { font-size:.86rem; }
.em-fs-88 { font-size:.88rem; }
.em-fs-90 { font-size:.9rem; }
.em-auto-main { flex:1; min-width:260px; }
.em-auto-nome { font-size:1.02rem; }
.em-w-num { width:90px; }
.em-w-180 { max-width:180px; }
.em-w-200 { max-width:200px; }
.em-w-230 { max-width:230px; }
.em-w-240 { max-width:240px; }
.em-w-260 { max-width:260px; }
.em-w-280 { max-width:280px; }
.em-w-320 { max-width:320px; }
.em-w-340 { max-width:340px; }
.em-w-360 { max-width:360px; }
/* Altura das caixas de texto menores que o padrão de textarea.em-code (300px). */
textarea.em-h-110 { min-height:110px; }
textarea.em-h-130 { min-height:130px; }
textarea.em-h-150 { min-height:150px; }
textarea.em-h-200 { min-height:200px; }
