/* Content Engine - ADScelera Styles */

:root {
  --brand: #1a6fe8;
  --brand-dark: #014bae;
  --brand-dim: rgba(26, 111, 232, 0.14);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.13);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.12);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.14);
  --bg: #0A0F1E;
  --bg-elevated: #141b2d;
  --bg-tertiary: #1a2236;
  --border: #2d3f58;
  --border-active: #4a607e;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #566a84;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sh-sm: 0 2px 6px rgba(0,0,0,0.3);
  --sh-md: 0 4px 12px rgba(0,0,0,0.35);
  --r-sm: 6px;
  --r-md: 10px;
  --ease: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.logo-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-name em {
  font-style: normal;
  color: var(--brand);
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-dim);
  color: var(--brand);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Layout wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 240px;
  min-height: 100vh;
  min-width: 0;
}

/* Main */
.main-content {
  flex: 1;
  padding: 24px 32px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  min-width: 220px;
  transition: border-color var(--ease);
}

.search-box:focus-within {
  border-color: var(--brand);
}

.search-box i {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.search-box input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
}

/* Button icon */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  font-size: 1rem;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

/* Logo label */
.logo-label {
  display: flex;
  flex-direction: column;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

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

.sidebar-footer-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* Stat card */
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrap.blue {
  background: rgba(1, 75, 174, 0.15);
  color: var(--brand);
}

.stat-icon-wrap.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-icon-wrap.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.stat-icon-wrap.purple {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-trend {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}

.stat-trend.up {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.stat-trend.neutral {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

/* Card subtitle */
.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Pipeline */
.pipeline {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 24px;
  margin-bottom: 20px;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pipeline-step.active .step-num {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: var(--brand);
  color: white;
  box-shadow: 0 2px 8px rgba(26, 111, 232, 0.4);
}

.step-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pipeline-step.active .step-label {
  color: var(--brand);
  font-weight: 500;
}

.pipeline-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 16px;
}

/* Form select standalone */
.form-select {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--ease);
  outline: none;
}

.form-select:focus {
  border-color: var(--brand);
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, rgba(26,111,232,0.06), transparent);
}

.card-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 20px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: all var(--ease);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text);
}

.btn:hover {
  background: var(--border);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(26, 111, 232, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2e80f5, var(--brand));
  box-shadow: 0 4px 14px rgba(26, 111, 232, 0.45);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #2dd068, #22c55e);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-dim);
}

.btn-purple {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-purple:hover {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.btn-orange {
  background: linear-gradient(135deg, var(--orange), #ea6c0a);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-orange:hover {
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

/* Checkbox Cards */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.checkbox-card {
  position: relative;
  padding: 16px 12px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.checkbox-card:hover {
  border-color: var(--border-active);
}

.checkbox-card input {
  position: absolute;
  opacity: 0;
}

.checkbox-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.checkbox-card .icon {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-card .icon svg {
  width: 32px;
  height: 32px;
}

.checkbox-card .title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.checkbox-card .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-primary {
  background: var(--brand-dim);
  color: var(--brand);
}

.tag-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.tag-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.tag-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-paused {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* List Items */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--ease);
}

.list-item:hover {
  background: rgba(255,255,255,0.03);
}

.list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

.list-content {
  flex: 1;
}

.list-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 111, 232, 0.35);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}

.modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .header {
    padding: 12px 16px;
  }

  .search-box {
    min-width: 0;
    width: 160px;
  }

  .main-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Notícias */
.noticia-card {
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--ease);
}

.noticia-card:hover {
    border-color: var(--orange);
    border-left-color: var(--orange);
    background: var(--orange-dim);
    transform: translateX(2px);
}

.noticia-titulo {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.noticia-resumo {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.noticia-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.noticia-card.selecionada {
    border-color: var(--brand);
    border-left-color: var(--brand);
    background: var(--brand-dim);
    box-shadow: 0 0 0 2px rgba(26,111,232,0.25);
}

/* Checkbox cards por canal */
.checkbox-card:has([value="blog"]) svg { color: var(--brand); }
.checkbox-card:has([value="blog"]):has(input:checked) { border-color: var(--brand); background: var(--brand-dim); }

.checkbox-card:has([value="linkedin"]) svg { color: var(--cyan); }
.checkbox-card:has([value="linkedin"]):has(input:checked) { border-color: var(--cyan); background: var(--cyan-dim); }

.checkbox-card:has([value="gmb"]) svg { color: var(--orange); }
.checkbox-card:has([value="gmb"]):has(input:checked) { border-color: var(--orange); background: var(--orange-dim); }

.checkbox-card:has([value="instagram"]) svg { color: var(--purple); }
.checkbox-card:has([value="instagram"]):has(input:checked) { border-color: var(--purple); background: var(--purple-dim); }

/* Tags mais vibrantes */
.tag-primary { background: var(--brand-dim); color: var(--brand); }
.tag-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.tag-warning { background: var(--orange-dim); color: var(--orange); }
.tag-danger  { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Nav item active mais vibrante */
.nav-item.active {
  background: var(--brand-dim);
  color: var(--brand);
}
.nav-item.active::before {
  background: linear-gradient(to bottom, var(--brand), var(--brand-dark));
}
