/* ==============================================================
   DIVULGADOR PRO - PAINEL ADMINISTRATIVO (STANDALONE SAAS)
   Design System: Branco e Vermelho Rubi (Salem Store / Divulgador Pro)
   Mesmo estilo, paleta e identidade visual do site principal
============================================================== */

:root {
  /* Tema Suave: Branco e Vermelho (Salem Store / Divulgador Pro) */
  --primary: #e11d48; /* Vermelho rubi moderno */
  --primary-hover: #be123c;
  --primary-dark: #9f1239;
  --primary-darker: #881337;
  --primary-light: #ffe4e6;
  --primary-subtle: #fff1f2;
  --primary-border: #fecdd3;
  --primary-gradient: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  --primary-gradient-hover: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);

  --bg-main: #f8fafc;
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fdfdfd;
  --bg-input: #ffffff;
  --bg-subtle: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #e11d48;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;
  --danger-border: #fca5a5;
  --danger-text: #991b1b;

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fef3c7;
  --warning-border: #fcd34d;
  --warning-text: #b45309;

  --success: #10b981;
  --success-hover: #059669;
  --success-light: #dcfce7;
  --success-border: #86efac;
  --success-text: #15803d;

  --info: #0284c7;
  --info-light: #e0f2fe;
  --info-border: #bae6fd;
  --info-text: #0369a1;

  --sidebar-width: 275px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(225, 29, 72, 0.08);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================
   LAYOUT PRINCIPAL: SIDEBAR + MAIN AREA
============================================================== */

.admin-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-body);
}

/* BARRA LATERAL (SIDEBAR) */
.admin-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  box-shadow: 2px 0 10px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  border: 2px solid var(--primary-border);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-logo:hover {
  transform: scale(1.06) rotate(3deg);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.3);
}

.sidebar-subtitle {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Status do WhatsApp Admin na Sidebar */
.sidebar-wa-card {
  margin: 14px 14px 8px;
  padding: 11px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wa-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wa-status-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-status-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-wa-action {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-wa-action:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Navegação da Sidebar (Abas) */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  padding: 14px 14px 4px;
}

.sidebar-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 12px);
  margin: 2px 6px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: #475569;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  position: relative;
}

.sidebar-tab-btn:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateX(2px);
}

.sidebar-tab-btn.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
  border: 1px solid var(--primary-border);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.08);
}

.sidebar-tab-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-tab-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.sidebar-tab-btn.active .sidebar-tab-badge {
  background: var(--primary);
  color: #ffffff;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  font-family: inherit;
}

.sidebar-footer-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.sidebar-footer-logout:hover {
  background: #fff1f2;
  color: #dc2626;
  border-color: #fecdd3;
}

/* ==============================================================
   ÁREA PRINCIPAL (MAIN CONTENT)
============================================================== */

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-body);
}

/* Topbar */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-mobile-toggle {
  display: none;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.25rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.topbar-title-group h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.topbar-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-stat-pill {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-stat-pill strong {
  color: var(--primary);
  font-weight: 800;
}

/* Área de Conteúdo Scrollável */
.admin-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 60px 32px;
  background: var(--bg-body);
}

/* Painéis de Aba */
.admin-tab-pane {
  display: none;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================================
   CARDS & CONTAINERS
============================================================== */

.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.05);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.admin-card-filter {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.card-header-clean h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.card-header-clean p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==============================================================
   BOTÕES (DIVULGADOR PRO / SALEM STORE STYLE)
============================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
  line-height: 1.25;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  border-color: rgba(225, 29, 72, 0.2);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.38);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1e293b;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.2);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

.btn-outline-danger {
  background: #ffffff;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.05);
}

.btn-outline-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.12);
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 0.76rem; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ==============================================================
   FORM CONTROLS & INPUTS
============================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .form-row-grid, .grid-2-col {
    grid-template-columns: 1fr;
  }
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-addon {
  display: flex;
  align-items: center;
}

.input-with-addon .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.addon-label {
  background: #f1f5f9;
  border: 1.5px solid var(--border-color);
  border-left: none;
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ==============================================================
   TABELAS
============================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #fdf2f4;
}

/* ==============================================================
   BADGES & STATUS
============================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-pro {
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.3);
}

.badge-primary, .badge-plan {
  background: var(--primary-subtle);
  color: var(--primary-hover);
  border: 1px solid var(--primary-border);
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Status Dots */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.disconnected {
  background: #ef4444;
}

.status-dot.connecting {
  background: #f59e0b;
  animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==============================================================
   BANNERS DE CONEXÃO & CALLOUTS
============================================================== */

.recovery-connection-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #166534;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.recovery-connection-banner.warning {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.info-callout-clean {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ==============================================================
   ABA DE DISPAROS & RECUPERAÇÃO (2 COLUNAS)
============================================================== */

.recovery-admin-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .recovery-admin-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.recovery-config-box,
.recovery-leads-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.recovery-textarea {
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
}

/* Chips de Variáveis */
.variable-chips-container, .recovery-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-variable-chip, .btn-tag {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: monospace;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-variable-chip:hover, .btn-tag:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

/* Gravador de Áudio & PTT */
.audio-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #9f1239;
}

.recording-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseDot 1s infinite;
}

.audio-preview-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.audio-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-html-player {
  width: 100%;
  height: 36px;
}

/* Barra de Progresso */
.broadcast-progress-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.progress-bar-bg {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--primary-gradient);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.broadcast-mini-log {
  max-height: 120px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
}

/* ==============================================================
   TERMINAL DE LOGS DOS CLIENTES
============================================================== */

.admin-logs-terminal-expanded {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #f8fafc;
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
  padding: 16px;
  font-size: 0.82rem;
  line-height: 1.6;
  max-height: 520px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-entry-row {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 10px;
}

.log-time { color: #64748b; }
.log-level-error { color: #f87171; font-weight: 700; }
.log-level-warn { color: #fbbf24; font-weight: 700; }
.log-level-success { color: #4ade80; font-weight: 700; }
.log-level-info { color: #94a3b8; }
.log-msg { color: #f1f5f9; }

/* ==============================================================
   CARDS DE RESUMO (INDIQUE & GANHE)
============================================================== */

.admin-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-icon {
  background: var(--primary-subtle);
  color: var(--primary);
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border: 1px solid var(--primary-border);
  flex-shrink: 0;
}

.summary-info small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-info strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* ==============================================================
   MODAIS
============================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 28px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--primary);
  background: var(--primary-subtle);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-qr-box {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
}

/* ==============================================================
   OVERLAY DE LOGIN ADMINISTRATIVO
============================================================== */

.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #fff1f2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.admin-login-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 38px 34px;
  box-shadow: 0 20px 25px -5px rgba(225, 29, 72, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  animation: slideUp 0.3s ease;
  text-align: center;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.3);
  border: 3px solid var(--primary-border);
  margin-bottom: 14px;
  display: inline-block;
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(225, 29, 72, 0.3); }
  50% { transform: scale(1.04); box-shadow: 0 12px 30px rgba(225, 29, 72, 0.45); }
}

.login-brand h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* ==============================================================
   UTILITÁRIOS & HELPERS
============================================================== */

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-xs { font-size: 0.76rem; }
.text-sm { font-size: 0.84rem; }
.font-bold { font-weight: 700; }

.text-success { color: #15803d; }
.text-danger { color: #dc2626; }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.py-4 { padding-top: 20px; padding-bottom: 20px; }

.hidden { display: none !important; }

/* Backdrop Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: none;
}

.sidebar-backdrop.active {
  display: block;
}

/* ==============================================================
   RESPONSIVIDADE (MOBILE & TABLET)
============================================================== */

@media (max-width: 992px) {
  .btn-mobile-toggle {
    display: inline-flex;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .topbar-right .topbar-stat-pill {
    display: none;
  }

  .admin-content-area {
    padding: 16px 14px 40px 14px;
  }

  .admin-card {
    padding: 16px;
  }

  .card-header-clean {
    flex-direction: column;
    align-items: flex-start;
  }
}
