:root {
  --primary: #3d2e1e;
  --primary-light: #5a4530;
  --accent: #25d366;
  --accent-dark: #1da851;
  --danger: #e74c5e;
  --warning: #f0ad4e;
  --info: #3b82f6;
  --bg: #e8e8e8;
  --bg-card: #f0f0f0;
  --bg-white: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #ddd;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== LANDING PAGE ===== */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: transparent;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.btn-enter {
  background: var(--primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
}
.btn-enter:hover { background: var(--primary-light); transform: translateY(-2px); }

.hero {
  text-align: center;
  padding: 80px 20px 60px;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 30px;
}
.hero-badge {
  display: inline-block;
  border: 2px solid var(--danger);
  color: var(--danger);
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 500;
  margin-bottom: 30px;
  background: rgba(231,76,94,0.05);
}
.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 16px 40px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}
.btn-cta:hover { background: var(--accent-dark); transform: translateY(-2px); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 3rem; margin-bottom: 16px; }
.feature-card h2 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text); }
.feature-card p { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; }

/* ===== AUTH PAGE ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3d2e1e 0%, #5a4530 50%, #3d2e1e 100%);
  background-size: cover;
  padding: 20px;
}
.auth-card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-card h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-card .subtitle { color: var(--text-light); margin-bottom: 24px; font-size: 0.9rem; }
.auth-card .auth-btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ===== PANEL LAYOUT ===== */
.panel-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--primary);
  color: #fff;
  padding: 0;
  position: fixed;
  height: 100vh;
  left: -280px;
  top: 0;
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
}
.sidebar.open { left: 0; }

@media (min-width: 769px) {
  .sidebar { left: 0; }
  .main-content { margin-left: 280px; }
  .btn-menu { display: none !important; }
  .sidebar-header button { display: none; }
  .top-bar .logo { display: none; }
  .sidebar-overlay { display: none !important; }
}

.sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo { color: #fff; }

.sidebar-nav { list-style: none; padding: 10px 0; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.sidebar-nav li a .nav-icon { font-size: 1.2rem; width: 24px; text-align: center; }

.main-content {
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar .logo { font-size: 24px; }
.btn-menu {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.btn-logout {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-email {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .top-bar-email { max-width: 120px; font-size: 0.8rem; }
}

.content-area { padding: 20px 24px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ===== COMMON COMPONENTS ===== */
.page-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
}
.page-section.no-border { border-left: none; }

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-icon { font-size: 2rem; opacity: 0.6; }

.dashboard-summary-title { font-size: 1.1rem; color: var(--text-muted); margin: 24px 0 16px; display: flex; align-items: center; gap: 8px; }
.dashboard-summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 8px; }
.dashboard-summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  border-left: 4px solid var(--accent);
}
.dashboard-summary-card .dashboard-summary-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.dashboard-summary-card .dashboard-summary-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Template form card (tela adicionar template) */
.template-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin: 20px 0 24px;
  border: 1px solid var(--border);
}
.template-form-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.template-form-card-title { font-size: 1.15rem; font-weight: 600; margin: 0; color: var(--text); }
.template-form-cancel-x {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.template-form-cancel-x:hover { opacity: 0.9; }
.template-form-card-body .form-group { margin-bottom: 16px; }
.template-field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.template-media-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.template-media-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.template-media-opt input { display: none; }
.template-media-opt:hover { border-color: var(--accent); background: rgba(200, 80, 120, 0.06); }
.template-media-opt-active,
.template-media-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.template-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.template-list-title { font-size: 1rem; color: var(--text-muted); margin: 8px 0 12px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-info {
  background: var(--info);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

.btn-pink {
  background: #e91e8c;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--bg-white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,211,102,0.1);
}

.table-container { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:hover td { background: rgba(0,0,0,0.02); }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-text { background: #e8e8e8; color: #555; }
.badge-image { background: #dbeafe; color: #1d4ed8; }
.badge-processing { background: #93c5fd; color: #1e40af; padding: 4px 10px; border-radius: 12px; font-weight: 600; font-size: 0.85rem; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-paused { background: #fef3c7; color: #92400e; }
.badge-stopped { background: #fee2e2; color: #991b1b; }
.badge-sent { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #e0e7ff; color: #3730a3; }
.badge-qualified { background: #d1fae5; color: #065f46; }
.badge-closed { background: #d1fae5; color: #065f46; }
.badge-lost { background: #fee2e2; color: #991b1b; }

.badge-connected { background: #d1fae5; color: #065f46; }
.badge-disconnected { background: #fee2e2; color: #991b1b; }
.badge-qr { background: #fef3c7; color: #92400e; }

.progress-bar {
  background: var(--border);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}
.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }

.info-banner {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.dev-banner {
  border: 2px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  background: rgba(231,76,94,0.05);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== DEVICE CARD ===== */
/* ===== Device Table Layout ===== */
.dev-table {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dev-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}
.dev-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.dev-table-row:last-child { border-bottom: none; }
.dev-table-row:hover { background: #fafafa; }

.dev-col-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
}
.dev-col-name i { color: var(--text-muted); font-size: 1.1rem; }
.dev-col-status { font-size: 0.9rem; color: var(--text-dark); }
.dev-col-clean { font-size: 0.9rem; }
.dev-col-flow { font-size: 0.9rem; }
.dev-col-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.badge-clean {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}
.badge-clean-off {
  display: inline-block;
  background: #ccc;
  color: #666;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}
.dev-qr-row {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.dev-qr-row .qr-container img {
  max-width: 280px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.device-flow-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg-white);
  cursor: pointer;
}

.dev-action-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: opacity 0.15s, transform 0.15s;
  color: #fff;
}
.dev-action-btn:hover { opacity: 0.85; transform: scale(1.08); }
.dev-action-btn.dev-action-yellow {
  background: #e6a817;
}
.dev-action-btn.dev-action-blue {
  background: #17a2b8;
}
.dev-action-btn.dev-action-gold {
  background: #e6a817;
}
.dev-action-btn.dev-action-green {
  background: #0d9488;
}

.qr-container {
  text-align: center;
  padding: 20px;
  width: 100%;
}
.qr-container img { max-width: 280px; border-radius: 8px; }

/* ===== Modal QR Code (conexão) ===== */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: qrModalFadeIn 0.2s ease;
}
@keyframes qrModalFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.qr-modal-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  animation: qrModalSlideIn 0.25s ease;
}
@keyframes qrModalSlideIn {
  from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); }
}
.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 12px;
}
.qr-modal-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
}
.qr-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  cursor: pointer;
  color: #64748b;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.qr-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.qr-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  padding: 20px 24px 8px;
}
.qr-modal-body {
  padding: 16px 24px 24px;
  text-align: center;
}
.qr-modal-body img {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.qr-modal-footer {
  padding: 0 24px 24px;
  text-align: center;
}
.qr-modal-footer .btn-qr-close {
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.qr-modal-footer .btn-qr-close:hover {
  background: #e2e8f0;
}

/* ===== Modal Conectado com sucesso ===== */
.success-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
  animation: qrModalFadeIn 0.2s ease;
}
.success-modal-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 380px;
  width: 100%;
  overflow: hidden;
  animation: qrModalSlideIn 0.25s ease;
  text-align: center;
  padding: 32px 24px;
}
.success-modal-icon {
  width: 72px;
  height: 72px;
  background: #d1fae5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-size: 2.2rem;
  margin: 0 auto 20px;
}
.success-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 24px;
}
.success-modal-box .btn-success-concluir {
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.success-modal-box .btn-success-concluir:hover {
  opacity: 0.9;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== PLAN CARD ===== */
.plan-card {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.plan-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.plan-feature {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.plan-feature .icon { font-size: 2rem; margin-bottom: 8px; }
.plan-feature h4 { margin-bottom: 4px; }
.plan-feature p { color: var(--text-muted); font-size: 0.85rem; }

/* ===== DELAY PRESETS ===== */
.delay-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.delay-preset {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.delay-preset:hover, .delay-preset.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== FLOW CARD ===== */
.flow-card {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
}
.flow-info h4 { margin-bottom: 2px; }
.flow-info .flow-type { font-size: 0.8rem; color: var(--text-muted); }

/* ===== TOGGLE SWITCH ===== */
.toggle {
  position: relative;
  width: 50px;
  height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(24px); }

/* ===== INSTRUCTIONS ===== */
.instructions { padding: 0; margin: 10px 0; }
.instructions li {
  padding: 6px 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .features { padding: 20px; }
  .content-area { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-section { animation: fadeIn 0.3s ease; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== DEVICE PANEL (modal grande de dispositivo) ===== */
.device-panel-content {
  background: var(--bg-white);
  width: 95vw;
  max-width: 800px;
  max-height: 92vh;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.device-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.device-panel-header h2 { font-size: 1.3rem; font-weight: 700; }

.device-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.dp-action-btn {
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dp-action-btn:hover { background: #f0f0f0; border-color: #aaa; }
.dp-btn-green {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.dp-btn-green:hover { background: var(--accent-dark) !important; }

.device-panel-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.dp-filter label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dp-filter select,
.dp-filter input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg-white);
}
.dp-search-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}
.dp-search-btn:hover { background: #f0f0f0; }

.device-panel-table {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}
.dp-table-header {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  background: #f5f5f5;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.dp-col-check { width: 40px; flex-shrink: 0; }
.dp-col-name { flex: 1; }
.dp-col-members { width: 80px; text-align: center; flex-shrink: 0; }
.dp-col-actions { width: 60px; text-align: center; flex-shrink: 0; }

.dp-group-row {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}
.dp-group-row:hover { background: #fafafa; }

.dp-group-name {
  font-weight: 500;
  margin-right: 8px;
  font-size: 0.92rem;
}
.dp-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 6px;
  vertical-align: middle;
}
.dp-badge-admin { background: var(--accent); color: #fff; }
.dp-badge-member { background: #e8e8e8; color: #555; border: 1px solid #ccc; }

.dp-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.dp-icon-btn:hover { opacity: 1; }

.dp-actions-menu { position: relative; }
.dp-dots-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 4px 8px;
  color: var(--text-muted);
}
.dp-dots-btn:hover { color: var(--text); }
.dp-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
}
.dp-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.dp-dropdown button:hover { background: #f5f5f5; }

/* ===== BATCH BAR ===== */
.dp-batch-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px; background: #e8f0fe; border: 1px solid #a8c7fa;
  border-radius: 8px; margin: 0 16px 8px; font-size: 0.9rem; color: #1a5276;
}
.dp-batch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dp-batch-btn {
  padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 600;
}
.dp-batch-yellow { background: #f5b041; color: #1a1a1a; }
.dp-batch-yellow:hover { background: #e5a030; }
.dp-batch-green { background: #27ae60; color: #fff; }
.dp-batch-green:hover { background: #219a54; }
.dp-batch-red { background: #e74c3c; color: #fff; }
.dp-batch-red:hover { background: #c0392b; }
.dp-batch-clear { background: #95a5a6; color: #fff; }
.dp-batch-clear:hover { background: #7f8c8d; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 6px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.btn-sm.btn-primary { background: var(--accent); color: white; }
.btn-sm.btn-secondary { background: #6c757d; color: white; }
.btn-sm.btn-danger { background: var(--danger); color: white; }

/* ===== UTILITIES ===== */
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.flex-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }

/* ===== MODAL CARD SECTIONS ===== */
.modal-card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fafafa;
}
.modal-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 12px 0 8px;
}
.btn-pink-square {
  width: 44px; height: 44px;
  background: #e91e8c; color: #fff; border: none; border-radius: 8px;
  cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-pink-square:hover { opacity: 0.85; }

/* Media type tabs (green active) */
.media-tabs { display: flex; margin-top: 8px; border-radius: 8px; overflow: hidden; border: 1px solid #e0e0e0; }
.media-tab {
  flex: 1; padding: 10px 6px; border: none; background: #fff; cursor: pointer;
  font-size: 0.8rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: all 0.2s; white-space: nowrap;
}
.media-tab:not(:last-child) { border-right: 1px solid #e0e0e0; }
.media-tab.active { background: var(--accent); color: #fff; }
.media-tab:hover:not(.active) { background: #f5f5f5; }

/* Recipient tabs (pink active) */
.recip-tabs { display: flex; margin-bottom: 12px; border-radius: 8px; overflow: hidden; }
.recip-tab {
  flex: 1; padding: 12px; border: none; background: #e0e0e0; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: #333;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s;
}
.recip-tab.active { background: #e91e8c; color: #fff; }
.recip-tab:hover:not(.active) { background: #d0d0d0; }

/* Dual Range Slider */
.range-slider-wrap {
  padding: 12px 16px; border: 1px solid #e0e0e0; border-radius: 12px; background: #fafafa; margin-top: 8px;
}
.range-badges { display: flex; gap: 4px; margin-bottom: 4px; }
.range-badge {
  display: inline-block; padding: 2px 8px; background: #e91e8c; color: #fff;
  border-radius: 4px; font-size: 0.75rem; font-weight: 700;
}
.range-track-area { position: relative; height: 36px; }
.range-track-area input[type="range"] {
  position: absolute; top: 8px; left: 0; width: 100%; height: 6px; margin: 0;
  pointer-events: none; -webkit-appearance: none; appearance: none; background: transparent; z-index: 2;
}
.range-track-area input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; background: var(--accent, #e91e8c);
  border: 3px solid #fff; border-radius: 50%; cursor: pointer; pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.range-track-area input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; background: var(--accent, #e91e8c); border: 3px solid #fff;
  border-radius: 50%; cursor: pointer; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.range-track-bg {
  position: absolute; top: 8px; left: 0; width: 100%; height: 6px;
  background: #e0e0e0; border-radius: 3px; z-index: 0;
}
.range-track-fill { position: absolute; top: 8px; height: 6px; background: var(--accent, #e91e8c); border-radius: 3px; z-index: 1; }
.range-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.72rem; }
.range-scale span { color: var(--text-muted); }
.range-scale span.range-limit { color: #e91e8c; font-weight: 700; }
.range-minmax { display: flex; justify-content: space-between; margin-top: 12px; }
.range-minmax-badge {
  display: inline-flex; padding: 4px 12px; border: 2px solid #e91e8c; color: #e91e8c;
  border-radius: 6px; font-size: 0.85rem; font-weight: 700;
}
.interval-display {
  text-align: center; padding: 10px 16px; border: 1px solid #e0e0e0;
  border-radius: 8px; margin-top: 12px; background: #fafafa;
}
.interval-configured { color: #e91e8c; font-weight: 700; font-size: 1rem; }
.interval-variation { color: var(--text-muted); font-size: 0.82rem; display: block; }

/* Warning / Info Boxes */
.warning-box {
  background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px;
  padding: 14px 16px; margin-top: 12px; font-size: 0.88rem; color: #856404;
  display: flex; align-items: flex-start; gap: 10px;
}
.warning-box i { color: #e0a800; flex-shrink: 0; margin-top: 3px; }
.warning-banner {
  background: #ffc107; color: #333; padding: 14px 20px; border-radius: 8px;
  font-weight: 600; margin: 16px 0; font-size: 0.92rem;
}
.info-box-blue {
  background: #00bcd4; color: #fff; border-radius: 8px;
  padding: 16px 20px; margin-top: 16px; font-size: 0.9rem;
}
.info-box-blue strong { display: block; margin-bottom: 6px; }
.info-box-blue ul { list-style: none; padding: 0; margin: 0; }
.info-box-blue ul li { padding: 2px 0; }
.info-box-blue ul li:before { content: "• "; }

/* Reference time box */
.ref-time-box {
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 16px;
  margin-top: 12px; background: #fafafa;
}
.ref-time-box h4 {
  font-size: 0.85rem; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.ref-time-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px;
  font-size: 0.82rem; color: var(--text-light);
}
@media (min-width: 600px) { .ref-time-grid { grid-template-columns: repeat(4, 1fr); } }

/* Hint / Daily Limit / Schedule */
.hint-yellow { color: #b8860b; font-size: 0.82rem; margin-top: 6px; }
.daily-limit-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #e0e0e0; margin-top: 12px;
}
.daily-limit-row h4 { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; margin: 0; }
.schedule-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 600; font-size: 0.95rem; }

/* Interval input row */
.interval-input-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.interval-input-row input[type="number"] {
  width: 80px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 0.95rem; text-align: center;
}
.interval-input-row span { color: var(--text-muted); font-size: 0.9rem; }

/* Full width button */
.btn-full {
  width: 100%; padding: 14px; font-size: 1rem; border-radius: 8px; margin-top: 16px;
  border: none; cursor: pointer; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-full.btn-green { background: var(--accent); color: #fff; }
.btn-full.btn-green:hover { background: var(--accent-dark); }
.btn-full.btn-pink { background: #e91e8c; color: #fff; }
.btn-full.btn-disabled { background: #ccc; color: #999; cursor: not-allowed; }

/* Processing table */
.proc-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.proc-table th { text-align: left; padding: 10px 6px; border-bottom: 2px solid #ddd; font-weight: 600; color: var(--text-muted); font-size: 0.78rem; }
.proc-table td { padding: 10px 6px; border-bottom: 1px solid #eee; vertical-align: middle; }
.proc-progress { display: flex; align-items: center; gap: 6px; }
.proc-progress-bar { flex: 1; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; min-width: 60px; }
.proc-progress-bar .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.proc-action-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; color: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; margin-right: 4px;
}
.proc-action-btn.green { background: var(--accent); }
.proc-action-btn.yellow { background: #f0ad4e; }
.proc-action-btn.red { background: var(--danger); }

/* History badges */
.badge-entered { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-approval { background: #f0ad4e; color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 12px 0; }
.pagination button {
  padding: 6px 10px; border: 1px solid #ddd; background: #fff;
  cursor: pointer; border-radius: 4px; font-size: 0.85rem;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:hover:not(.active) { background: #f0f0f0; }
.pagination-info { color: var(--text-muted); font-size: 0.82rem; padding: 4px 0; }

/* Two-column modal (Auto Limpeza) */
.clean-modal-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .clean-modal-layout { grid-template-columns: 1fr; } }
.clean-group-list { max-height: 350px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 8px; }
.clean-group-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0; font-size: 0.9rem;
}
.clean-group-item:last-child { border-bottom: none; }
.clean-group-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: #00bcd4; flex-shrink: 0; }

/* Export contacts modal */
.export-group-list { max-height: 400px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 8px; margin: 12px 0; }
.export-group-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; cursor: pointer;
}
.export-group-item:last-child { border-bottom: none; }
.export-group-item:hover { background: #fafafa; }
.export-group-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: #e91e8c; flex-shrink: 0; }
.export-format-row { display: flex; align-items: center; gap: 20px; margin: 12px 0; }
.export-format-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.export-format-row input[type="radio"] { accent-color: #e91e8c; width: 18px; height: 18px; }

/* Modal header with tabs */
.modal-header-with-tabs {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header-with-tabs h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.modal-header-tabs { display: flex; gap: 12px; align-items: center; }
.modal-header-tab {
  background: none; border: none; cursor: pointer; font-size: 0.88rem;
  color: var(--text-muted); display: flex; align-items: center; gap: 6px;
  font-weight: 500; padding: 4px 8px;
}
.modal-header-tab:hover { color: var(--text); }

/* Toggle switch */
.toggle-switch { position: relative; width: 50px; height: 26px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc; border-radius: 26px; transition: 0.3s;
}
.toggle-switch-slider:before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-switch-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-switch-slider:before { transform: translateX(24px); }
.toggle-switch.pink input:checked + .toggle-switch-slider { background: #e91e8c; }

/* Blacklist tabs */
.bl-tabs { display: flex; margin: 16px 0; gap: 0; overflow: hidden; }
.bl-tab {
  flex: 1; padding: 12px; border: none; background: #e8e8e8; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--text-light);
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s;
}
.bl-tab:first-child { border-radius: 8px 0 0 8px; }
.bl-tab:last-child { border-radius: 0 8px 8px 0; }
.bl-tab.active { background: #e91e8c; color: #fff; }

/* Access control group box */
.ac-group-box {
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px;
  max-height: 200px; overflow-y: auto; margin-bottom: 12px; background: #fafafa;
}
.divider-text {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  color: var(--text-muted); font-size: 0.88rem; font-weight: 600;
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: #e0e0e0; }

/* Selection buttons */
.selection-btns { display: flex; gap: 8px; }
.selection-btns button {
  padding: 6px 14px; border: 1px solid #ddd; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 0.82rem; font-weight: 500;
}
.selection-btns button:hover { background: #f0f0f0; }

/* Back button */
.btn-back {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  cursor: pointer; color: var(--text); font-weight: 500; font-size: 0.9rem;
}
.btn-back:hover { color: var(--text-muted); }

/* History table */
.history-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.history-table th { text-align: left; padding: 8px 6px; border-bottom: 2px solid #ddd; font-weight: 600; color: var(--text-muted); }
.history-table td { padding: 8px 6px; border-bottom: 1px solid #eee; vertical-align: middle; }
.history-table a { color: var(--accent); text-decoration: none; }
.history-table a:hover { text-decoration: underline; }

/* Histórico de Envios - painel em tabela (padrão zap.guiaste.io / Foto 1) */
.history-panel {
  background: var(--bg-white); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.history-panel-header {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.history-panel-header .page-title { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.history-subtitle { font-size: 1rem; font-weight: 600; color: var(--text-light); margin: 0; }
.history-header-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-history-pink {
  background: #e91e8c; color: #fff; border: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.btn-history-pink:hover { background: #d1187a; }
.btn-history-outline {
  background: #fff; color: #e91e8c; border: 2px solid #e91e8c;
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.btn-history-outline:hover { background: #fdf2f8; }
.btn-history-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.history-table-main { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.history-table-main th {
  text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--text-muted); background: #f8f9fa;
}
.history-table-main td { padding: 12px 14px; border-bottom: 1px solid #eee; vertical-align: middle; }
.history-table-main tbody tr.history-row { cursor: pointer; }
.history-table-main tbody tr:hover { background: #fafafa; }
.history-col-title { max-width: 320px; word-break: break-word; }
.history-status-cell { display: flex; align-items: center; gap: 10px; }
.history-status-bar {
  width: 40px; height: 8px; border-radius: 4px; background: #93c5fd;
  flex-shrink: 0;
}
.history-progress-cell {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.history-progress-cell .progress-bar { flex: 1; min-width: 80px; max-width: 160px; height: 10px; border-radius: 5px; overflow: hidden; background: #e0e0e0; }
.history-progress-cell .progress-bar .fill { height: 100%; background: #e91e8c; border-radius: 5px; }
.progress-bar-pink .fill { background: #e91e8c !important; }
.history-progress-nums { font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.history-progress-na-pill {
  font-size: 0.75rem; font-weight: 600; color: #1d4ed8;
  background: #dbeafe; padding: 2px 8px; border-radius: 10px;
}
.history-col-date { font-size: 0.85rem; }
.history-conclusao { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.history-action-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Ícones sem fundo (Ver e Excluir) */
.history-btn-icon {
  width: auto; min-width: 28px; height: 28px; padding: 0 4px;
  border: none; background: transparent; border-radius: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: opacity 0.2s;
}
.history-btn-icon:hover { opacity: 0.7; }
.history-btn-icon.history-btn-eye { color: #1a1a1a; }
.history-btn-icon.history-btn-del { color: #dc2626; }
/* Botões com fundo (Pausar e Interromper) */
.history-btn {
  width: 32px; height: 32px; border: none; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem;
  transition: opacity 0.2s;
}
.history-btn:hover { opacity: 0.9; }
.history-btn-pause { background: #facc15; color: #1a1a1a; }
.history-btn-stop { background: #dc2626; color: #1a1a1a; }

/* History list & detail (detalhe ao clicar) */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; cursor: pointer; transition: box-shadow 0.2s;
}
.history-card:hover { box-shadow: var(--shadow); }
.history-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.history-card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.history-card-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.history-card-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.history-card-progress .progress-bar { flex: 1; min-width: 0; }
.history-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Detalhe ao clicar no olho (padrão da imagem) */
.history-detail-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.history-detail-header-left { display: flex; align-items: center; gap: 16px; }
.history-detail-header .btn-back {
  background: #e5e7eb; color: #374151; padding: 8px 14px; border-radius: 10px; border: none;
  font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px;
}
.history-detail-header .btn-back:hover { background: #d1d5db; color: #1f2937; }
.history-detail-header .page-title { margin: 0; }
.history-detail-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-history-detail {
  padding: 10px 16px; border-radius: 10px; border: none; font-weight: 600; font-size: 0.9rem;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.btn-history-detail.btn-config { background: #e91e8c; color: #fff; }
.btn-history-detail.btn-pause { background: #facc15; color: #1a1a1a; }
.btn-history-detail.btn-stop { background: #ea580c; color: #fff; }
.btn-history-detail.btn-export { background: #22c55e; color: #fff; }
.btn-history-detail.btn-delete { background: #dc2626; color: #fff; }
.history-detail-card {
  background: #f3f4f6; border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-top: 16px;
}
.history-detail-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
.history-detail-info-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.history-detail-info-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: none; }
.history-detail-info-value { font-size: 0.95rem; color: var(--text); }
.history-detail-progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.history-detail-progress-wrap .progress-bar { flex: 1; min-width: 80px; max-width: 200px; height: 10px; border-radius: 6px; background: #e5e7eb; overflow: hidden; }
.history-detail-progress-wrap .progress-bar .fill { min-width: 2px; height: 100%; background: #e91e8c; border-radius: 6px; transition: width 0.2s ease; }
.history-detail-card .history-progress-label { font-size: 0.9rem; color: var(--text); }
.history-detail-card .history-previsao { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.history-summary-boxes { display: flex; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.history-summary-box {
  flex: 1; min-width: 120px; max-width: 180px; padding: 20px 24px; border-radius: 12px;
  text-align: center; border: 2px solid var(--border); display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.history-summary-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; order: 0; }
.history-summary-n { display: block; font-size: 2rem; font-weight: 800; order: 1; }
.history-summary-lbl { font-size: 0.85rem; color: var(--text-muted); order: 2; }
.history-summary-total { background: #f3f4f6; border-color: #d1d5db; }
.history-summary-ok { background: #d1fae5; border-color: #10b981; }
.history-summary-fail { background: #fee2e2; border-color: #ef4444; }
.history-detail-white-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.history-section-title { font-size: 1rem; margin: 0 0 14px 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.history-section-dot { width: 8px; height: 8px; border-radius: 50%; background: #e91e8c; flex-shrink: 0; }
.history-message-details .history-message-content { font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.history-batch-empty { padding: 16px; background: #f9fafb; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-muted); font-size: 0.9rem; }
.history-items-table-wrap { overflow-x: auto; }
.history-items-table-wrap .data-table,
.history-items-table-wrap .history-lote-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history-items-table-wrap th { text-align: left; padding: 12px 14px; border-bottom: 2px solid #e5e7eb; }
.history-items-table-wrap td { padding: 10px 14px; border-bottom: 1px solid #eee; }
.history-erro-cell { color: #dc2626; font-size: 0.8rem; max-width: 320px; word-break: break-word; }
.badge-feito { background: #22c55e; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; }
.badge-falha { background: #dc2626; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; }
.badge-pending { background: #6b7280; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; }

/* ===== Aquecedor de Números ===== */
.warmer-page { max-width: 1200px; }
.warmer-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
@media (max-width: 900px) { .warmer-layout { grid-template-columns: 1fr; } }
.warmer-panel {
  background: #f8f9fa; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px;
}
.warmer-panel-title { font-size: 1.1rem; margin: 0 0 20px 0; font-weight: 700; color: var(--text); }
.warmer-form .form-group { margin-bottom: 16px; }
.warmer-form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.warmer-select, .warmer-input {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; background: #fff;
}
.warmer-hint { font-size: 0.85rem; color: var(--text-muted); margin: -8px 0 16px 0; }
.warmer-field-desc { font-size: 0.8rem; color: var(--text-muted); margin: 6px 0 12px 0; }
.warmer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.warmer-toggle-row { margin-bottom: 16px; }
.warmer-toggle-label { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; font-weight: 500; }
.btn-warmer-save {
  background: #e91e8c; color: #fff; border: none; padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; cursor: pointer; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-warmer-save:hover { background: #c41a75; }
.warmer-intro { margin-bottom: 20px; padding: 14px 0; }
.warmer-intro p { margin: 0; font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }
.warmer-sep { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0; }
.warmer-empty-state { text-align: center; padding: 32px 20px; }
.warmer-empty-icon { display: block; font-size: 3rem; color: #d1d5db; margin-bottom: 12px; }
.warmer-empty-state .warmer-no-configs { margin: 0; }
.warmer-config-list { display: flex; flex-direction: column; gap: 16px; }
.warmer-config-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px;
}
.warmer-config-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.warmer-config-title { font-weight: 600; font-size: 0.95rem; }
.warmer-config-remove { background: none; border: none; cursor: pointer; padding: 4px; }
.warmer-config-details { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.warmer-config-details p { margin: 4px 0; }
.warmer-status-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; margin-bottom: 12px;
}
.warmer-status-inactive { background: #e91e8c; color: #fff; }
.warmer-status-active { background: #22c55e; color: #fff; }
.warmer-config-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-warmer {
  padding: 8px 14px; border-radius: 8px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-warmer-activate { background: #22c55e; color: #fff; }
.btn-warmer-activate:hover { background: #16a34a; }
.btn-warmer-edit, .btn-warmer-duplicate { background: #f3f4f6; color: #374151; border: 1px solid #9ca3af; }
.btn-warmer-edit:hover, .btn-warmer-duplicate:hover { background: #e5e7eb; }
.btn-warmer-stop { background: #dc2626; color: #fff; }
.btn-warmer-stop:hover { background: #b91c1c; }
.btn-warmer-delete { background: #dc2626; color: #fff; }
.btn-warmer-delete:hover { background: #b91c1c; }
.warmer-hint-bottom { font-size: 0.85rem; color: var(--text-muted); margin-top: 16px; }
.warmer-no-configs { padding: 20px; text-align: center; }
.warmer-unavailable-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 14px 18px; margin-bottom: 20px; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 10px; font-size: 0.9rem;
}
.warmer-unavailable-banner code { background: #fff; padding: 2px 6px; border-radius: 4px; }
.btn-warmer-retry {
  padding: 8px 16px; background: #e91e8c; color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-warmer-retry:hover { background: #c41a75; }
.warmer-pause-fields { margin-top: 12px; padding-left: 0; }
.warmer-pause-fields .warmer-row { margin-bottom: 12px; }
