/* ============================================================
   Bot Manual SuperMinas — visual moderno e responsivo
   ============================================================ */

:root {
  --green:    #1f6b3a;
  --green-d:  #134022;
  --green-l:  #2e8c4f;
  --gold:     #d4a52a;
  --gold-d:   #a17e1d;
  --gold-l:   #f4e9b3;
  --bg:       #f4f6f8;
  --bg-soft:  #fbfcfd;
  --card:     #ffffff;
  --text:     #18222d;
  --text-2:   #4a5563;
  --soft:     #7a8392;
  --border:   #e3e6eb;
  --border-l: #eef0f3;
  --wa:       #25d366;
  --wa-d:     #1ea854;
  --danger:   #d14545;
  --danger-l: #fde8e8;
  --shadow-sm: 0 1px 2px rgba(15, 25, 40, 0.04), 0 1px 4px rgba(15, 25, 40, 0.04);
  --shadow:    0 4px 16px rgba(15, 25, 40, 0.06), 0 2px 6px rgba(15, 25, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 25, 40, 0.09), 0 4px 10px rgba(15, 25, 40, 0.05);
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font); }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ============================================================
   HEADER (sticky, responsive)
   ============================================================ */

.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
}
.app-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-l) 100%);
  color: white;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(31,107,58,0.25);
}
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text .top { font-size: 16px; font-weight: 800; color: var(--green-d); }
.brand-text .sub { font-size: 11px; color: var(--soft); font-weight: 500; }

.etapa-pill {
  background: linear-gradient(135deg, var(--gold-l) 0%, #fdf3d0 100%);
  border: 1px solid var(--gold);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--green-d);
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.etapa-pill strong { color: var(--gold-d); }
.etapa-pill .sep { color: rgba(0,0,0,0.2); }

/* Stats bar (substitui search-box) */
.stats-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 18px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  min-width: 40px;
}
.stat-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--green-d);
}
.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.stat-sep {
  color: var(--border);
  font-size: 18px;
  line-height: 1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-top: 1px solid var(--border-l);
  background: var(--card);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--green-d); }
.tab.active {
  color: var(--green-d);
  border-bottom-color: var(--gold);
  font-weight: 700;
}
.tab .badge {
  background: var(--gold-l);
  color: var(--gold-d);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; }

/* View Templates (sidebar + editor) */
.view-templates { display: none; }
.view-templates.active {
  display: grid;
  grid-template-columns: 320px 1fr;
}

/* Sidebar */
aside.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
aside.sidebar::-webkit-scrollbar { width: 6px; }
aside.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.new-tpl-btn {
  margin: 14px;
  padding: 14px;
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  background: transparent;
  color: var(--green-d);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s, transform 0.1s;
}
.new-tpl-btn:hover { background: #f0f7f3; transform: translateY(-1px); }
.new-tpl-btn:active { transform: translateY(0); }

.cat-heading {
  padding: 18px 18px 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-d);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.tpl-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-l);
  transition: background 0.1s, padding 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
}
.tpl-item:hover { background: var(--bg-soft); }
.tpl-item.active {
  background: linear-gradient(90deg, #ecf6f0 0%, transparent 80%);
}
.tpl-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--green);
}
.tpl-item .ttl {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.tpl-item .pv {
  font-size: 11px;
  color: var(--soft);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpl-item .star { color: var(--gold); font-size: 14px; flex-shrink: 0; }

/* Editor area */
.editor {
  padding: 28px 36px;
  overflow-y: auto;
  background: var(--bg);
}
.editor::-webkit-scrollbar { width: 8px; }
.editor::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--soft);
  text-align: center;
  padding: 40px;
}
.empty .ico { font-size: 72px; opacity: 0.3; margin-bottom: 20px; }
.empty h2 { font-size: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.empty p { font-size: 14px; }

/* Card wrapper for content */
.card-block {
  background: var(--card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.cliente-card {
  background: linear-gradient(135deg, #f0f7f3 0%, #fef9e7 100%);
  border: 1px solid #c7e0d2;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.cliente-card .nome {
  font-size: 16px; font-weight: 700; color: var(--green-d);
  margin-bottom: 6px;
}
.cliente-card .info {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--text-2);
}
.cliente-card .info span { display: inline-flex; align-items: center; gap: 4px; }
.cliente-card .info b { color: var(--text); font-weight: 700; }

/* Fields */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,58,0.1);
}
.field textarea { resize: vertical; min-height: 260px; line-height: 1.6; }
.field .hint {
  font-size: 11px;
  color: var(--soft);
  margin-top: 5px;
}

.row2 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}
.row3 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr 1fr;
}

/* Buttons */
.btn {
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-wa {
  background: var(--wa);
  color: white;
  padding: 13px 24px;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(37,211,102,0.32);
}
.btn-wa:hover { background: var(--wa-d); box-shadow: 0 4px 14px rgba(37,211,102,0.4); }
.btn-sec { background: #eef1f5; color: var(--text); }
.btn-sec:hover { background: #e1e5eb; }
.btn-sec.active, .bc-tipo-btn.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31,107,58,0.25);
}
.btn-save {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(31,107,58,0.2);
}
.btn-save:hover { background: var(--green-d); box-shadow: 0 4px 12px rgba(31,107,58,0.28); }
.btn-danger { background: var(--danger-l); color: var(--danger); }
.btn-danger:hover { background: #fbd2d2; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}

/* Placeholder hints */
.placeholders {
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--soft);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.placeholders code {
  background: var(--card);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--green-d);
  font-weight: 600;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  border: 1px solid var(--border);
  transition: background 0.1s, transform 0.1s;
}
.placeholders code:hover {
  background: #f0f7f3;
  transform: translateY(-1px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok  { background: var(--green); }

/* ============================================================
   STATUS BAILEYS (header)
   ============================================================ */

.wa-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  white-space: nowrap;
}
.wa-status:hover { background: var(--border-l); }

.wa-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}
.wa-dot.connected  { background: var(--wa);      box-shadow: 0 0 0 2px rgba(37,211,102,0.25); }
.wa-dot.qr         { background: var(--gold);    box-shadow: 0 0 0 2px rgba(212,165,42,0.25); }
.wa-dot.connecting { background: #a0a0a0; }
.wa-dot.offline    { background: var(--danger);  box-shadow: 0 0 0 2px rgba(209,69,69,0.2); }

/* ============================================================
   MODAL QR CODE
   ============================================================ */

.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  backdrop-filter: blur(3px);
}
.qr-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.qr-modal h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--green-d);
  margin-bottom: 10px;
}
.qr-modal p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 20px;
}
.qr-close {
  position: absolute;
  top: 14px; right: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  font-size: 13px;
  color: var(--soft);
  display: grid; place-items: center;
}
.qr-close:hover { background: var(--border-l); }
.qr-img-wrap {
  background: var(--bg-soft);
  border: 2px solid var(--border-l);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.qr-img-wrap img { width: 100%; max-width: 260px; border-radius: 6px; display: block; }
.qr-loading { color: var(--soft); font-size: 13px; }
.qr-hint {
  font-size: 11px !important;
  color: var(--soft) !important;
  margin-bottom: 0 !important;
}



.preview-box {
  background: var(--card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Cabeçalho do painel direito ── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

/* ── Navegação prev/next + input de nome ── */
.browser-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-nav {
  padding: 8px 12px !important;
  font-size: 16px !important;
  flex-shrink: 0;
  line-height: 1;
}

/* Input editável com o nome do arquivo — destaque grande */
.filename-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--green-d);
  background: #f0f7f3;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.filename-input:focus {
  outline: none;
  border-color: var(--gold);
  background: white;
  box-shadow: 0 0 0 3px rgba(212,165,42,0.18);
}
.filename-input::placeholder {
  font-size: 12px;
  font-weight: 400;
  color: var(--soft);
  font-family: var(--font);
}

/* Contador de posição (3 / 47) */
.browser-contador {
  font-size: 11px;
  color: var(--soft);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Imagem grande do título em branco */
.browser-thumb-large {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-l);
  box-shadow: var(--shadow);
  margin-top: 4px;
}

/* Linha abaixo da imagem: input do nome + botão salvar */
.rename-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.rename-row .filename-input {
  flex: 1;
  min-width: 0;
}
.btn-rename {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 10px 14px !important;
  font-size: 13px !important;
}

/* Campo de busca de cliente (linha acima dos botões de ação) */
.busca-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-top: 4px;
}
.busca-field:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,58,0.12);
}
.busca-field::placeholder { color: var(--soft); }

/* Título já gerado — imagem preenchida */
.preview-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: block;
}

/* Botões de ação após geração (copiar / baixar / WA) */
.titulo-actions-box {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.preview-empty {
  background: var(--bg-soft);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px 20px;
  text-align: center;
  color: var(--soft);
}
.preview-empty .ico { font-size: 56px; opacity: 0.3; margin-bottom: 16px; }

/* ============================================================
   VIEW: Pendentes (Titulos_Gerados aguardando pagamento)
   ============================================================ */
.view-pendentes {
  padding: 24px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}
.view-pendentes.active { display: flex; }

.pendentes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.pendentes-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 3px;
}
.pendentes-header p {
  font-size: 12px;
  color: var(--soft);
}
.pendentes-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--soft);
}
.pendentes-empty .ico {
  font-size: 56px;
  opacity: 0.3;
  display: block;
  margin-bottom: 16px;
}

.pendente-card {
  background: var(--card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: box-shadow 0.15s;
}
.pendente-card:hover { box-shadow: var(--shadow); }

.pendente-img-wrap {
  flex-shrink: 0;
  width: 110px;
}
.pendente-img-wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-l);
  display: block;
}

.pendente-info { flex: 1; min-width: 0; }

.pendente-nome {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pendente-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 14px;
}
.pendente-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pendente-meta b    { color: var(--text); font-weight: 700; }

.pendente-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* (browser de títulos migrado para o painel direito — ver .preview-box acima) */

/* ============================================================
   Busca inline de cliente (dentro do form de título)
   ============================================================ */
.search-inline {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.search-inline-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 10px;
}
.search-row {
  display: flex;
  gap: 8px;
}
.search-row input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,58,0.1);
}
.sugestoes-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
}
.sugestao-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-l);
  cursor: pointer;
  transition: background 0.1s;
}
.sugestao-item:hover  { background: var(--bg-soft); }
.sugestao-item:last-child { border-bottom: none; }
.sugestao-item strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.sugestao-item span   { font-size: 11px; color: var(--soft); }

/* Botão fixo "+ Novo cliente" abaixo das ações do formulário */
.btn-novo-cliente {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 14px;
  background: none;
  border: 1.5px dashed var(--green);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.btn-novo-cliente:hover {
  background: #f0f7f3;
  border-style: solid;
}

/* ── Sugestão "+ Novo cliente" no rodapé da lista ── */
.sugestao-novo {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  border-top: 1px dashed var(--border);
  background: #f0f7f3;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: background 0.1s;
}
.sugestao-novo:hover { background: #e0f0e8; }

/* ============================================================
   VIEW: Calibrar campos
   ============================================================ */
.view-calibrar {
  padding: 24px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  flex: 1;
}
.view-calibrar.active { display: flex; }

.calibrar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.calibrar-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 3px;
}
.calibrar-header p { font-size: 12px; color: var(--soft); }
.calibrar-actions { display: flex; gap: 10px; align-items: center; }

.calibrar-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* Painel esquerdo: imagem + labels */
.calibrar-wrap {
  background: var(--card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  overflow: auto;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.calibrar-loading {
  color: var(--soft);
  font-size: 13px;
  padding: 40px;
  text-align: center;
}

/* Painel direito: instruções + lista de campos */
.calibrar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calibrar-hint {
  background: var(--gold-l);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}

/* Labels arrastáveis — estilizadas inline via JS */
.cal-label {
  position: absolute;
  transition: box-shadow 0.1s;
}
.cal-label:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important; }

/* ============================================================
   MODAL: Cadastrar novo cliente
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  padding: 28px 28px 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.modal-sub {
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--soft);
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.modal-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.modal-grid input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
}
.modal-grid input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,58,0.1);
}
.modal-grid label:first-child,
.modal-grid label:nth-child(5) {
  grid-column: span 2;   /* Nome e Endereço ocupam linha inteira */
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-l);
}

/* ============================================================
   RESPONSIVE — mobile-first adjustments
   ============================================================ */

@media (max-width: 900px) {
  .view-templates.active { grid-template-columns: 1fr; }
  aside.sidebar {
    max-height: 38vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .editor { padding: 18px; }
  .titulo-grid { grid-template-columns: 1fr; }
  .preview-box { position: static; }
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  .app-header-row { padding: 12px 14px; gap: 10px; }
  .brand-text .sub { display: none; }
  .etapa-pill { font-size: 11px; padding: 5px 10px; }
  .stats-bar { margin-left: 0; order: 99; width: 100%; justify-content: center; }
  .tabs { padding: 0 8px; }
  .tab { padding: 11px 12px; font-size: 12px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .editor { padding: 14px; }
  .card-block { padding: 16px; }
  .field textarea { min-height: 200px; }
  .btn { padding: 11px 14px; font-size: 13px; }
  .btn-wa { padding: 13px 20px; font-size: 14px; }
  .actions { gap: 8px; }
  .toast { font-size: 13px; padding: 11px 18px; max-width: calc(100% - 24px); }
  .cliente-card .info { font-size: 11px; gap: 10px; }
  .pendente-card { flex-direction: column; }
  .pendente-img-wrap { width: 100%; max-width: 200px; }
  .pendentes-header { flex-direction: column; }
}

/* ============================================================
   MATRIZ DE TÍTULOS
   ============================================================ */

.view-matriz {
  padding: 24px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  flex: 1;
  gap: 20px;
}
.view-matriz.active { display: flex; }

/* Cabeçalho */
.matriz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.matriz-header h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--text); }
.matriz-header p  { margin: 0; font-size: 13px; color: var(--text-2); }
.matriz-header-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* Grid esquerda / direita */
.matriz-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  flex: 1;
  align-items: start;
}
.matriz-left  { display: flex; flex-direction: column; gap: 12px; }
.matriz-right { min-height: 200px; }

/* Títulos de seção */
.matriz-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.matriz-hint {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

/* Grid de dezenas 1-60 */
.dezena-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin: 6px 0 2px;
}
.dezena-btn {
  aspect-ratio: 1;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.dezena-btn:hover { border-color: var(--green); background: rgba(31,107,58,0.07); }
.dezena-btn.selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  transform: scale(1.08);
}

/* Controles abaixo do grid */
.dezena-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.dezena-sel-count { font-size: 12px; color: var(--text-2); }

.btn-xs {
  padding: 5px 10px !important;
  font-size: 11px !important;
  border-radius: 5px !important;
}

/* Selects de tipo/top */
.matriz-tipo-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.matriz-tipo-row label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.campo-select {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  background: white;
  cursor: pointer;
}
.campo-select:focus { outline: none; border-color: var(--green); }

/* Cards de resultado */
.matriz-right .preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  color: var(--text-2);
  gap: 10px;
  text-align: center;
}
.matriz-right .preview-empty .ico { font-size: 36px; }
.matriz-right .preview-empty p { font-size: 13px; line-height: 1.5; }

.titulo-card {
  background: var(--card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}
.titulo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }

.titulo-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.titulo-tipo-badge {
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.titulo-codigo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Courier New', monospace;
}
.match-badge {
  margin-left: auto;
  background: #e8f5ec;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

/* Dezenas pills */
.dez-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  margin-top: 8px;
}
.dez-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.dez-pill {
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border-l);
  font-family: 'Courier New', monospace;
}
.dez-pill.dez-match {
  background: #e8f5ec;
  color: var(--green);
  border-color: rgba(31,107,58,0.25);
}

/* Barcodes */
.barcode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-l);
}
.barcode-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.barcode-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.barcode-val {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border-l);
  transition: background 0.12s;
  word-break: break-all;
}
.barcode-val:hover { background: #e8f5ec; color: var(--green); }

/* Barra de progresso de importação */
.import-progress {
  position: relative;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border-l);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-top: 8px;
}
.import-progress-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--green);
  opacity: 0.18;
  transition: width 0.4s;
}
.import-progress span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 0 14px;
}

/* Barcode preview dentro do modal */
.barcode-preview-box {
  background: var(--bg);
  border: 1px solid var(--border-l);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.barcode-preview-box .barcode-row { flex-direction: row; align-items: center; gap: 10px; }
.barcode-preview-box .barcode-lbl { flex-shrink: 0; min-width: 140px; }
.barcode-preview-box code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE — Matriz
   ============================================================ */
@media (max-width: 900px) {
  .matriz-grid { grid-template-columns: 1fr; }
  .barcode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dezena-grid { grid-template-columns: repeat(8, 1fr); }
  .view-matriz { padding: 14px; }
}

/* ============================================================
   MATRIZ — DUP duplo cartão + estoque
   ============================================================ */

/* Badge DUP especial */
.titulo-tipo-badge.dup {
  background: #7c3aed;
}

/* Container dos dois cartões lado a lado */
.dup-cartoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.dup-cartao {
  background: var(--bg);
  border: 1px solid var(--border-l);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.dup-cartao-titulo {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* Estoque */
.estoque-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.estoque-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.estoque-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  min-width: 44px;
}
.estoque-input {
  flex: 1;
  padding: 7px 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  background: white;
  min-width: 0;
}
.estoque-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,58,0.1);
}

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

/* ============================================================
   GERAR TÍTULO — novo layout estilo Super Minas
   ============================================================ */

.view-titulo {
  display: none;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
}
.view-titulo.active { display: flex; }

.titulo-form-col {
  width: 1000px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 14px 12px 14px 14px;
  border-right: 1px solid var(--border-l);
}

/* Espaçamento compacto exclusivo da coluna do formulário de título */
.titulo-form-col .field { margin-bottom: 7px; }
.titulo-form-col .field label {
  margin-bottom: 2px;
  font-size: 10px;
}
.titulo-form-col .field input,
.titulo-form-col .field select {
  padding: 5px 9px;
  font-size: 12px;
}
.titulo-form-col .row2 { gap: 7px; }
.titulo-form-col .actions { margin-top: 8px; gap: 6px; }
.titulo-form-col .btn { padding: 7px 13px; font-size: 12px; }
.titulo-form-col h2 { margin-bottom: 4px !important; font-size: 13px !important; }
.titulo-form-col .search-inline { margin-top: 4px; }
.titulo-form-col .tf-titulo-info { padding: 5px 8px; margin-bottom: 4px; }
.titulo-form-col .tf-section-title { margin-bottom: 5px; margin-top: 2px; }
.titulo-form-col .btn-novo-cliente { margin-top: 6px; font-size: 11px; padding: 5px 10px; }
.titulo-search-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header vermelho estilo SM */
.sm-header {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 40%, #e67e22 100%);
  color: #fff;
  flex-shrink: 0;
}
.sm-edicao-bar {
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: stretch;
}
.sm-edicao-blk {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sm-edicao-blk + .sm-edicao-blk { border-left: 1px solid rgba(255,255,255,0.18); }
.sm-edicao-lbl {
  font-size: 8px;
  font-weight: 600;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 1px;
}
.sm-selector-area {
  display: flex;
  align-items: center;
  padding: 6px 14px 8px;
}
.sm-balls-col { flex: 1; }
.sm-balls-row {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
  justify-content: space-between;
}
.sm-ball {
  flex: 1;
  max-width: 44px;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.55) 28%, transparent 55%),
    radial-gradient(circle at 62% 72%, rgba(0,0,0,0.18) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #f0f0f0 0%, #d8d8d8 50%, #b4b4b4 100%);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
  user-select: none;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.sm-ball:hover { transform: scale(1.15); box-shadow: 0 3px 8px rgba(0,0,0,0.4); }
.sm-ball.selected {
  background:
    radial-gradient(circle at 38% 30%, rgba(255,255,255,0.85) 0%, rgba(255,220,220,0.4) 30%, transparent 55%),
    radial-gradient(circle at 62% 72%, rgba(120,0,0,0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #f15a50 0%, #c0392b 50%, #922b21 100%);
  color: #fff;
  border: none;
  transform: scale(1.12);
  box-shadow: 0 3px 8px rgba(192,57,43,0.55), inset 0 1px 0 rgba(255,200,200,0.6);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Barra de ação abaixo do header */
.sm-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border-l);
  flex-shrink: 0;
}
.sm-sel-count { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.sm-action-sep { width: 1px; height: 16px; background: var(--border-l); flex-shrink: 0; }
.sm-limpar-link {
  background: none; border: none; font-size: 11px;
  color: #c0392b; cursor: pointer; padding: 0;
  text-decoration: underline; flex-shrink: 0; white-space: nowrap;
}
.sm-num-input { padding: 6px 10px; font-size: 12px; flex: 1; min-width: 0; }

/* Área de resultados — carrossel horizontal */
.sm-resultados {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #f0f2f5;
  overflow: hidden;
  min-height: 0;
}
.sm-resultados-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 200px;
  color: var(--text-2);
  text-align: center;
  gap: 10px;
}
.sm-resultados-empty .ico { font-size: 40px; }
.sm-resultados-empty p { font-size: 13px; line-height: 1.6; }

/* Carrossel de resultados */
.sm-carousel-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.sm-carousel-row {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 0;
}
.sm-nav-btn {
  width: 52px;
  flex-shrink: 0;
  background: rgba(192,57,43,0.08);
  border: none;
  font-size: 36px;
  font-weight: 900;
  color: #c0392b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.sm-nav-btn:hover { background: rgba(192,57,43,0.18); }
.sm-nav-btn:disabled { color: #ccc; cursor: default; background: transparent; }
.sm-carousel-card-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.sm-carousel-counter {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  padding: 6px 0 10px;
  letter-spacing: 0.04em;
}
/* Grid legado (não usado no carrossel) */
.sm-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Card estilo Super Minas */
.sm-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.1s;
  width: 100%;
  max-width: 800px;
}
.sm-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.18); transform: translateY(-1px); }

.sm-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 7px 12px 4px;
  background: #fff;
}
.sm-card-num-label { font-size: 9px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.05em; }
.sm-card-num {
  font-size: 22px;
  font-weight: 900;
  color: #c0392b;
  font-family: 'Courier New', monospace;
  letter-spacing: -0.02em;
}
.sm-card-gira {
  text-align: right;
  font-size: 10px;
  color: #555;
  line-height: 1.7;
}
.sm-card-gira strong { color: #222; font-family: 'Courier New', monospace; }

.sm-prize-block {
  background: #c0392b;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 12px 5px;
}
.sm-prize-liq {
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sm-prize-val {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Grid de dezenas 2 linhas × 10 colunas */
.sm-dez-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0;
  border-left: 1px solid #ddd;
  border-top: 1px solid #ddd;
  margin: 0 12px 4px;
}
.sm-dez-grid + .sm-dez-section-label {
  margin-top: 6px;
}
.sm-dez {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #222;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  background: #fff;
  transition: background 0.1s;
}
.sm-dez.match {
  background: #fff0f0;
  color: #c0392b;
}
.sm-dez-section-label {
  font-size: 9px;
  font-weight: 800;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px 1px;
}

.sm-card-footer {
  padding: 6px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #eee;
}

.tf-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 0 4px;
  border-bottom: 1px solid var(--border-l);
  margin-bottom: 8px;
  margin-top: 4px;
}
.tf-titulo-info {
  background: #fff8f8;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.tf-t-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 0;
  font-size: 11px;
}
.tf-t-label { color: var(--text-2); }
.tf-t-val { color: var(--text); font-weight: 600; font-family: 'Courier New', monospace; }
.tf-t-num { font-size: 15px; font-weight: 900; color: #c0392b; }

/* ============================================================
   CONFIGURAÇÕES — layout combinado
   ============================================================ */

.view-config {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}
.view-config.active { display: flex; }

.config-2col {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}
.config-left-col { display: flex; flex-direction: column; gap: 16px; }
.config-right-col { display: flex; flex-direction: column; }

.config-sec-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-hint {
  font-size: 12px;
  color: var(--text-2);
  margin: 0 0 12px;
  line-height: 1.5;
}

.config-calibrar-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.config-calibrar-card .calibrar-body {
  flex: 1;
  margin-top: 8px;
}

/* Ajuste do calibrar dentro do config (não mais fullpage) */
.config-calibrar-card .calibrar-wrap {
  max-height: 500px;
}

@media (max-width: 1000px) {
  .titulo-form-col { width: 260px; }
  .config-2col { grid-template-columns: 1fr; }
  .sm-ball { width: 25px; height: 25px; font-size: 10px; }
}
@media (max-width: 700px) {
  .view-titulo { flex-direction: column; }
  .titulo-form-col { width: 100%; border-right: none; border-bottom: 1px solid var(--border-l); padding: 14px; max-height: 40vh; }
  .sm-selector-area { flex-direction: column; }
  .sm-cards-grid { grid-template-columns: 1fr; }
}
/* ── Faixas de estoque ──────────────────────────────────────────────────── */
.faixa-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.faixas-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 24px;
}
.faixa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f9fc;
  border: 1px solid var(--border-l);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}
.faixa-item .faixa-tipo {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: 8px;
}
.faixa-item .faixa-tipo.sim { background: #d4edda; color: #1a6b3a; }
.faixa-item .faixa-tipo.dup { background: #cce5ff; color: #185fa5; }
.faixa-item .faixa-del {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.faixa-item .faixa-del:hover { opacity: 1; background: #fff0f0; }


/* ── Calibrador ampliado ────────────────────────────────────────────────── */
.cal-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0 10px;
  flex-wrap: wrap;
}
.cal-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--border-l);
}
.cal-field-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-field-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cal-del-btn {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}
.cal-del-btn:hover { opacity: 1; background: #fff0f0; }

/* Animação shake para chamar atenção no painel de título */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
