/* ── Dashboard Layout v1 (legacy) ─────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 24px 28px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 100%;
}

/* ── Dashboard Layout v2 (current) ──────────────────── */
.dashboard-v2 {
  display: flex; flex-direction: column; gap: 20px;
  padding: 24px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

/* Responsividade — ajusta padding em telas menores */
@media (max-width: 900px) {
  .dashboard-v2 { padding: 16px 18px; gap: 14px; }
  .dashboard-v2 .dash-welcome { flex-direction: column; align-items: stretch; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1; min-width: 0; }
}
@media (max-width: 600px) {
  .quick-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .dash-tab { white-space: nowrap; }
}
.dashboard-v2 .dash-welcome {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tabs */
.dash-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}
.dash-tab {
  background: none; border: none; padding: 10px 18px;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 8px;
  transition: color .15s ease, border-color .15s ease;
}
.dash-tab:hover { color: var(--text-primary); }
.dash-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  background: var(--bg3); color: var(--text-muted);
  padding: 1px 8px; border-radius: 10px; font-size: 10px; font-weight: 700;
}
.dash-tab.active .tab-count { background: var(--accent-dim); color: var(--accent); }
.tab-pane { min-height: 300px; }

/* News */
.news-head { display: flex; align-items: center; gap: 10px; }
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.news-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s ease;
}
.news-card:hover { border-color: var(--accent); }
.news-cat {
  display: inline-block; align-self: flex-start;
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 10px; border-radius: 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.news-title { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
.news-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.news-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.news-meta a { color: var(--accent); text-decoration: none; }
.news-meta a:hover { text-decoration: underline; }
.news-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.news-actions .btn-ghost.danger { background: rgba(255,60,60,0.1); color: #ff6b6b; }
.news-actions .btn-ghost.danger:hover { background: rgba(255,60,60,0.2); }

/* Trend-specific styling (from Apify) */
.news-card.trend-card {
  border-color: rgba(255, 180, 0, 0.25);
  background: linear-gradient(180deg, rgba(255,180,0,0.04), var(--bg2));
}
.news-card.trend-card:hover { border-color: rgba(255, 180, 0, 0.6); }
.news-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.news-cat.trend {
  background: linear-gradient(90deg, rgba(255, 180, 0, 0.2), rgba(255, 100, 50, 0.2));
  color: #ffb400;
  border: 1px solid rgba(255, 180, 0, 0.3);
}
.viral-score {
  font-size: 10px; font-weight: 700;
  background: rgba(255, 60, 60, 0.15); color: #ff6b6b;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
}
.news-angle {
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 8px 10px; border-radius: 6px;
  line-height: 1.4;
  border-left: 3px solid var(--accent);
}

.dash-main { display: flex; flex-direction: column; gap: 20px; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }

/* ── Welcome header ────────────────────────────────────── */
.dash-welcome {
  display: flex; align-items: center; gap: 16px;
}
.dash-welcome h1 {
  font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
}
.dash-welcome h1 .accent { color: var(--accent); }
.dash-welcome p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Quick stats row ───────────────────────────────────── */
.quick-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.quick-stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all var(--duration) var(--ease);
}
.quick-stat:hover { border-color: var(--border-hi); }
.quick-stat .icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.quick-stat .icon.red { background: var(--accent-dim); }
.quick-stat .icon.green { background: var(--green-dim); }
.quick-stat .icon.blue { background: var(--blue-dim); }
.quick-stat .icon.yellow { background: var(--yellow-dim); }

/* ── Carousel grid ─────────────────────────────────────── */
.carousel-grid-head {
  display: flex; align-items: center; gap: 12px;
}
.carousel-grid-head h2 { font-size: 15px; font-weight: 700; }
.carousel-grid-head .count {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg3); padding: 2px 8px;
  border-radius: 99px; font-weight: 600;
}

.carousel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ── Carousel card ─────────────────────────────────────── */
.carousel-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
}
.carousel-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.carousel-card .thumb {
  width: 100%; aspect-ratio: 1080/1350;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.carousel-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.carousel-card .thumb .placeholder {
  color: var(--text-muted); font-size: 11px; font-family: monospace;
}
.carousel-card .overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity .15s;
}
.carousel-card:hover .overlay { opacity: 1; }
.carousel-card .overlay .btn { pointer-events: all; }
.carousel-card .info { padding: 10px 12px; }
.carousel-card .info .title {
  font-size: 12px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.carousel-card .info .bottom {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
}
.carousel-card .info .slug {
  font-size: 10px; color: var(--text-muted); font-family: monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.carousel-card .info .slides-count {
  font-size: 10px; color: var(--text-muted); font-weight: 600;
  background: var(--bg3); padding: 1px 6px; border-radius: 99px; flex-shrink: 0;
}
.carousel-card .brand-dot-card {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ── Quick create card ─────────────────────────────────── */
.quick-create {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.quick-create .head {
  padding: 14px 16px 10px;
  display: flex; align-items: center; gap: 8px;
}
.quick-create .head h3 { font-size: 13px; font-weight: 700; flex: 1; }
.quick-create .head .spark { font-size: 16px; }
.quick-create .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.quick-create textarea {
  width: 100%; height: 70px; resize: none;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; color: var(--text);
  font-size: 13px; outline: none; transition: border-color var(--duration);
}
.quick-create textarea:focus { border-color: var(--accent); }
.quick-create textarea::placeholder { color: var(--text-muted); }
.quick-create .options { display: flex; gap: 8px; }
.quick-create .options .select { flex: 1; }

/* ── Weekly stats card ─────────────────────────────────── */
.weekly-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.weekly-card h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.weekly-bars { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.weekly-bar {
  flex: 1; background: var(--bg4); border-radius: 3px 3px 0 0;
  min-height: 4px; position: relative; transition: height .3s var(--ease);
}
.weekly-bar.active { background: var(--accent); }
.weekly-bar .day {
  position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--text-muted); font-weight: 600;
}

/* ── Streak card ───────────────────────────────────────── */
.streak-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; align-items: center; gap: 16px;
}
.streak-card .fire { font-size: 32px; }
.streak-card .info { flex: 1; }
.streak-card .current { font-size: 24px; font-weight: 800; line-height: 1; }
.streak-card .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.streak-card .best { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.streak-card .best b { color: var(--yellow); }

/* ── Ideas card ────────────────────────────────────────── */
.ideas-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.ideas-card h3 {
  padding: 14px 16px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
}
.idea-item {
  padding: 9px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: background .1s;
}
.idea-item:hover { background: var(--bg3); }
.idea-item .icon { font-size: 14px; flex-shrink: 0; }
.idea-item .text { font-size: 12px; font-weight: 500; flex: 1; }
.idea-item .arrow { color: var(--text-muted); font-size: 12px; }

/* ── Goal ring widget ──────────────────────────────────── */
.goal-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; align-items: center; gap: 16px;
}
.goal-card .info { flex: 1; }
.goal-card h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.goal-card .progress-text { font-size: 13px; font-weight: 600; }
.goal-card .progress-text b { color: var(--accent); font-size: 20px; }

/* ── Achievements card ─────────────────────────────────── */
.achievements-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.achievements-card h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.achievements-card h3 .count-badge {
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700;
}
.ach-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ach-badge {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all .2s ease;
  cursor: help;
}
.ach-badge.unlocked {
  background: linear-gradient(145deg, var(--accent-dim), transparent);
  border-color: var(--accent);
}
.ach-badge.locked { opacity: .4; }
.ach-badge .icon { font-size: 22px; }
.ach-badge .label { font-size: 10px; font-weight: 600; text-align: center; line-height: 1.2; }
.ach-badge .desc { font-size: 9px; color: var(--text-muted); text-align: center; margin-top: 2px; }
.ach-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 16px 0; grid-column: 1/-1; }

.ach-full-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ach-full-grid .ach-badge { padding: 16px 10px; }
.ach-full-grid .ach-badge .icon { font-size: 32px; }
.ach-full-grid .ach-badge .label { font-size: 12px; margin-top: 4px; }

/* ── Inline search in dashboard ───────────────────────── */
.carousel-grid-head .search-inline { flex: 0 0 220px; }
.carousel-grid-head .search-inline input {
  font-size: 12px; padding: 6px 10px; height: 30px;
}

/* ── Spinner for buttons ──────────────────────────────── */
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Delete button in card ─────────────────────────────── */
.carousel-card .overlay .btn-ghost.danger {
  background: rgba(255,60,60,0.1); color: #ff6b6b; border: 1px solid rgba(255,60,60,0.3);
}
.carousel-card .overlay .btn-ghost.danger:hover {
  background: rgba(255,60,60,0.2); border-color: #ff6b6b;
}

/* ── Keyboard shortcuts modal ─────────────────────────── */
.kbd-list { display: flex; flex-direction: column; gap: 10px; }
.kbd-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.kbd-row:last-child { border-bottom: none; }
.kbd-row kbd {
  display: inline-block; padding: 2px 8px; min-width: 24px;
  background: var(--bg3); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
  text-align: center;
}
.kbd-row span { flex: 1; margin-left: 8px; font-size: 13px; }

/* ══════════════════════════════════════════════════════ */
/* TEMPLATE GALLERY                                         */
/* ══════════════════════════════════════════════════════ */
.template-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.template-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 10px; overflow: hidden; cursor: pointer;
  transition: all .18s ease;
}
.template-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.template-thumb {
  aspect-ratio: 4/5; background-size: cover; background-position: center;
  background-color: var(--bg2);
}
.template-info { padding: 10px 12px 12px; }
.template-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 4px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.template-meta .brand-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}

/* ══════════════════════════════════════════════════════ */
/* CREATE WIZARD                                            */
/* ══════════════════════════════════════════════════════ */
.wizard-modal { display: flex; flex-direction: column; }
.wizard-steps {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
  gap: 6px;
}
.wizard-step {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: all .2s ease; flex-shrink: 0;
}
.wizard-step .n {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border);
  font-size: 10px; font-weight: 700;
}
.wizard-step.active { color: var(--accent); background: var(--accent-dim); }
.wizard-step.active .n { background: var(--accent); color: #fff; border-color: var(--accent); }
.wizard-step.done { color: var(--text-secondary); }
.wizard-step.done .n { background: var(--green, #2ecc71); color: #fff; border-color: var(--green, #2ecc71); }

.wizard-body { padding: 24px; min-height: 240px; }
.wizard-label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 10px;
}
.wizard-textarea {
  width: 100%; min-height: 100px; padding: 12px 14px;
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 8px; font-size: 14px; color: var(--text-primary);
  resize: vertical; outline: none;
  font-family: inherit; line-height: 1.5;
}
.wizard-textarea:focus { border-color: var(--accent); }
.wizard-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 8px; font-size: 14px; color: var(--text-primary);
  outline: none;
}
.wizard-input:focus { border-color: var(--accent); }
.wizard-hint {
  color: var(--text-muted); font-size: 12px; margin-top: 10px;
  line-height: 1.5;
}

.wizard-brand-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.wizard-brand-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 10px; padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all .15s ease;
  text-align: center;
}
.wizard-brand-card:hover { border-color: var(--accent); }
.wizard-brand-card.active {
  border-color: var(--accent); background: var(--accent-dim);
}
.wizard-brand-card .brand-dot {
  width: 28px; height: 28px; border-radius: 50%;
}
.wizard-brand-card .name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.wizard-brand-card .niche { font-size: 10px; color: var(--text-muted); }

.wizard-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.wizard-chip {
  padding: 8px 14px; background: var(--bg3);
  border: 2px solid var(--border); border-radius: 20px;
  color: var(--text-secondary); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
  text-transform: capitalize;
}
.wizard-chip:hover { border-color: var(--accent); }
.wizard-chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.wizard-slide-counts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.wizard-slide-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 10px; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; transition: all .15s ease;
  text-align: center;
}
.wizard-slide-card:hover { border-color: var(--accent); }
.wizard-slide-card.active {
  border-color: var(--accent); background: var(--accent-dim);
}
.wizard-slide-card .n { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.wizard-slide-card .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.wizard-slide-card .desc { font-size: 10px; color: var(--accent); font-weight: 600; margin-top: 4px; text-transform: capitalize; }

.wizard-review {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.review-row {
  display: flex; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.review-row:last-child { border-bottom: none; }
.review-row .lbl {
  font-weight: 700; color: var(--text-muted);
  flex: 0 0 70px;
}
.review-row .val {
  color: var(--text-primary);
  display: flex; align-items: center; gap: 6px; flex: 1;
}
.review-row .val .brand-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}

.wizard-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--bg2);
}

.wizard-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 60px 20px; text-align: center;
}
.wizard-loading h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.wizard-loading p { font-size: 13px; color: var(--text-muted); max-width: 360px; line-height: 1.5; }
.spinner-big {
  width: 42px; height: 42px;
  border: 4px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .9s linear infinite;
}

/* ══════════════════════════════════════════════════════ */
/* BRAND MANAGER                                            */
/* ══════════════════════════════════════════════════════ */
.brand-list { display: flex; flex-direction: column; gap: 10px; }
.brand-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  transition: border-color .15s ease;
}
.brand-row:hover { border-color: var(--accent); }
.brand-dot-lg { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.brand-info { flex: 1; min-width: 0; }
.brand-name-lg { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.brand-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.brand-actions { display: flex; gap: 6px; flex-shrink: 0; }
.brand-actions .btn-ghost.danger { background: rgba(255,60,60,0.1); color: #ff6b6b; border: 1px solid rgba(255,60,60,0.3); }
.brand-actions .btn-ghost.danger:hover { background: rgba(255,60,60,0.2); }

.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.form-row small { font-size: 11px; color: var(--text-muted); }
.form-row input[disabled] { opacity: .5; cursor: not-allowed; }

.section-label {
  font-size: 13px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em;
  margin-top: 10px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.color-row { display: flex; flex-direction: column; gap: 4px; }
.color-row label { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.color-input {
  width: 44px; height: 36px; padding: 2px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent; cursor: pointer;
}

.logo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.logo-upload-row {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.logo-upload-row label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.logo-preview {
  background: var(--bg2); border: 1px dashed var(--border);
  border-radius: 6px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }
.logo-preview span { font-size: 11px; color: var(--text-muted); }

/* Brand row danger action */
.brand-manager-overlay .empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

/* ── Schedule cards (Calendário tab) ──────────────────── */
.schedule-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.schedule-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.schedule-card.status-scheduled { border-left-color: #ffb400; }
.schedule-card.status-publishing { border-left-color: var(--accent); }
.schedule-card.status-published { border-left-color: #2ecc71; opacity: .75; }
.schedule-card.status-failed { border-left-color: #ff6b6b; }
.sc-head { display: flex; align-items: center; justify-content: space-between; }
.sc-status {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--bg3); color: var(--text-muted);
  padding: 3px 9px; border-radius: 10px;
}
.schedule-card.status-scheduled .sc-status { background: rgba(255,180,0,.15); color: #ffb400; }
.schedule-card.status-publishing .sc-status { background: var(--accent-dim); color: var(--accent); }
.schedule-card.status-published .sc-status { background: rgba(46,204,113,.15); color: #2ecc71; }
.schedule-card.status-failed .sc-status { background: rgba(255,107,107,.15); color: #ff6b6b; }
.sc-title { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.sc-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sc-when { font-family: monospace; }
.sc-meta a { color: var(--accent); text-decoration: none; }
.sc-meta a:hover { text-decoration: underline; }
.sc-error {
  font-size: 11px; color: #ff6b6b;
  background: rgba(255,107,107,.08); padding: 6px 10px; border-radius: 6px;
  line-height: 1.4;
}
.sc-post { font-size: 11px; color: var(--text-muted); }
.sc-post code { background: var(--bg3); padding: 1px 6px; border-radius: 4px; font-size: 10px; }

/* ══════════════════════════════════════════════════════════
   VIEWS v3 — tema claro editorial (Home/Library/Calendar/Brands/Templates)
   ══════════════════════════════════════════════════════════ */
.view-wrap { max-width: 1240px; margin: 0 auto; padding: 30px 30px 60px; animation: rise .4s ease both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13.5px; max-width: 560px; }
.section-head { display: flex; align-items: center; margin-bottom: 14px; }
.section-head h3 { font-size: 15px; font-weight: 700; }
.link-btn { margin-left: auto; background: transparent; border: none; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; font-family: inherit; display: flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--accent-2); }

/* Home greeting */
.home-greeting { margin-bottom: 22px; }
.home-greeting .today { color: var(--muted); font-size: 13px; margin-bottom: 4px; text-transform: capitalize; }
.home-greeting h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }

/* AI command bar */
.ai-bar { background: linear-gradient(180deg,#fff,#fdfdfb); border: 1px solid var(--border-2); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.ai-bar-glow { position: absolute; inset: 0; background: radial-gradient(900px 200px at 12% -40%, rgba(123,92,255,.10), transparent); pointer-events: none; }
.ai-bar-inner { position: relative; }
.ai-bar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ai-spark { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-grad); color: #fff; }
.ai-bar-title { font-weight: 600; font-size: 14px; }
.ai-bar-brand { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ai-bar-brand b { color: var(--text); font-weight: 600; }
.ai-bar-row { display: flex; gap: 10px; align-items: stretch; }
.ai-bar-row textarea { flex: 1; resize: none; height: 62px; border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 14px; line-height: 1.4; color: var(--text); background: #fff; outline: none; }
.ai-bar-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ai-bar-go { flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 120px; background: var(--accent-grad); border: none; border-radius: 12px; cursor: pointer; color: #fff; font-weight: 600; font-size: 13.5px; font-family: inherit; box-shadow: 0 8px 20px rgba(109,84,255,.3); transition: transform var(--duration) var(--ease); }
.ai-bar-go:hover { transform: translateY(-1px); }
.ai-bar-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ai-chip { display: flex; align-items: center; gap: 6px; background: var(--subtle); border: 1px solid var(--border-3); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: var(--text-2); font-family: inherit; }
.ai-chip:hover { border-color: var(--accent); color: var(--accent); }
.ai-chip.dashed { background: transparent; border: 1px dashed #D8D6CE; color: var(--text-3); }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 18px 0 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 7px; }
.stat-card-head { display: flex; align-items: center; gap: 8px; }
.stat-ic { display: flex; width: 24px; height: 24px; border-radius: 7px; align-items: center; justify-content: center; }
.stat-card-label { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.stat-card-val { display: flex; align-items: baseline; gap: 8px; }
.stat-card-val .mono { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat-delta { font-size: 12px; color: var(--muted); font-weight: 600; }

/* home two-col */
.home-cols { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 24px; }
.home-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* upcoming */
.upcoming-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; background: transparent; border: none; border-radius: 10px; cursor: pointer; text-align: left; font-family: inherit; }
.up-row:hover { background: var(--subtle); }
.up-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none; border-radius: 10px; background: var(--st-sched-tint); color: var(--st-sched-fg); }
.up-mon { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.up-day { font-size: 18px; font-weight: 700; line-height: 1; }
.up-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.up-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.up-empty { padding: 18px 12px; font-size: 12.5px; color: var(--muted); text-align: center; }
.up-add { margin: 4px 6px 6px; padding: 9px; background: var(--subtle); border: none; border-radius: 10px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12.5px; font-family: inherit; }
.up-add:hover { background: var(--subtle-2); }

/* autopilot */
.autopilot-card { background: linear-gradient(135deg,#1d1c19,#2a2722); border-radius: 14px; padding: 18px; color: #EDEBE4; position: relative; overflow: hidden; }
.autopilot-card.tall { padding: 20px; border-radius: 16px; }
.ap-glow { position: absolute; inset: 0; background: radial-gradient(300px 120px at 90% 10%, rgba(123,92,255,.25), transparent); }
.ap-inner { position: relative; }
.ap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 13.5px; }
.ap-head svg { stroke: #9A6BFF; }
.ap-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #1d1c19; background: #C9C4BC; padding: 2px 8px; border-radius: 20px; }
.ap-badge.on { background: #7BE0A0; }
.autopilot-card p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: #B6B3AB; }
.autopilot-card p b { color: #fff; }
.ap-btn { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 9px; cursor: pointer; color: #fff; font-weight: 600; font-size: 12.5px; font-family: inherit; }
.ap-btn:hover { background: rgba(255,255,255,.16); }
.ap-btn.light { background: #fff; color: #1A1916; border: none; }

/* ── Library grid + cards ──────────────────────────────── */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px,1fr)); gap: 18px; }
.lib-card { text-align: left; background: transparent; border: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 10px; font-family: inherit; transition: transform var(--duration) var(--ease); }
.lib-card:hover { transform: translateY(-3px); }
.lib-thumb { position: relative; display: block; width: 100%; aspect-ratio: 4/5; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(30,28,24,.10); border: 1px solid rgba(0,0,0,.06); transition: box-shadow var(--duration) var(--ease); }
.lib-card:hover .lib-thumb { box-shadow: 0 12px 28px rgba(30,28,24,.18); }
.lib-title-over { position: absolute; inset: 0; z-index: 1; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; font-size: 15px; font-weight: 700; line-height: 1.18; color: #fff; letter-spacing: -.01em; }
/* Imagem real do slide-01 por cima do gradiente-fallback. Some (onerror) se ainda não renderizou. */
.lib-thumb-img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); }
.lib-thumb-img.loaded { opacity: 1; }
.lib-hover { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(20,18,16,.4); opacity: 0; transition: opacity var(--duration) var(--ease); }
.lib-card:hover .lib-hover { opacity: 1; }
.lib-hover-btn { background: #fff; color: #1A1916; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 8px; }
.lib-hover-btn:hover { background: var(--subtle); }
.lib-hover-ic { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.92); border-radius: 8px; font-size: 13px; }
.lib-hover-ic:hover { background: #fff; }
.lib-hover-ic.danger { color: #B0463C; }
/* legenda abaixo do thumbnail (título + status) */
.lib-meta { display: flex; flex-direction: column; gap: 5px; }
.lib-titlerow { display: flex; align-items: center; gap: 8px; }
.lib-brand-dot { width: 16px; height: 16px; border-radius: 5px; flex: none; }
.lib-name { font-size: 13px; color: var(--text); font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-slides { font-size: 11px; color: var(--muted-3); flex: none; }
/* pill de status — evidente e clicável (tint/cor vêm inline do STATUS_META) */
.lib-statusrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 8px; border-radius: 20px; width: fit-content; cursor: pointer; margin-left: 24px; transition: filter var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.lib-statusrow:hover { filter: brightness(.97); box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset; }
.lib-sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lib-slabel { font-size: 11.5px; font-weight: 700; }
.lib-scaret { font-size: 9px; opacity: .6; margin-left: 1px; }

/* library filter bar */
.lib-filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-chip { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-2); border-radius: 20px; padding: 7px 14px; cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: inherit; }
.filter-chip .mono { opacity: .6; font-size: 11px; }
.filter-chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.lib-search-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 9px; padding: 7px 11px; color: var(--muted); }
.lib-search-wrap input { border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--text); width: 160px; }
.lib-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 4/5; border: 2px dashed #D8D6CE; border-radius: 14px; background: transparent; cursor: pointer; color: var(--text-3); font-family: inherit; }
.lib-new:hover { border-color: var(--accent); }
.lib-new-ic { display: flex; width: 46px; height: 46px; border-radius: 12px; align-items: center; justify-content: center; background: var(--accent-grad); color: #fff; }
.lib-new-t { font-weight: 600; font-size: 13.5px; color: var(--text); }
.lib-new-s { font-size: 11.5px; }

/* ── Calendar ──────────────────────────────────────────── */
.cal-cols { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }
.cal-week-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.cal-week-head { display: flex; align-items: center; margin-bottom: 14px; gap: 10px; }
.cal-week-head h3 { font-size: 15px; font-weight: 700; }
.cal-range { font-size: 12.5px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.cal-day { border: 1px solid var(--border-3); border-radius: 11px; min-height: 150px; padding: 9px; display: flex; flex-direction: column; gap: 7px; background: #fdfdfb; }
.cal-day-head { display: flex; align-items: center; gap: 6px; }
.cal-dow { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cal-date { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.cal-date.today { background: var(--dark); color: #fff; }
.cal-post { background: var(--subtle-3); border-left: 3px solid var(--st-sched); border-radius: 7px; padding: 6px 7px; cursor: pointer; }
.cal-post-t { font-size: 10.5px; font-weight: 700; line-height: 1.25; color: #2A2925; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-post-time { font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.cal-side { display: flex; flex-direction: column; gap: 16px; }
.cal-tips { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.cal-tips-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; font-size: 13.5px; }
.cal-tips-head svg { stroke: var(--warning); }
.cal-tips p { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

/* ── Brands page ───────────────────────────────────────── */
.brands-cols { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 24px; align-items: start; }
.brands-list { display: flex; flex-direction: column; gap: 10px; }
.brand-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 13px; cursor: pointer; text-align: left; font-family: inherit; }
.brand-item.active { border-color: var(--accent); background: var(--accent-tint-2); }
.brand-item-av { width: 42px; height: 42px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 17px; }
.brand-item-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.brand-item-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-item-handle { font-size: 12px; color: var(--muted); }
.brand-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.bd-head { padding: 22px 24px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border-3); }
.bd-av { width: 60px; height: 60px; border-radius: 15px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 24px; }
.bd-titles { flex: 1; }
.bd-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bd-handle { font-size: 13px; color: var(--muted); }
.bd-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 24px; }
.bd-palette { display: flex; gap: 14px; flex-wrap: wrap; }
.bd-swatch { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.bd-swatch > span:first-child { width: 60px; height: 60px; border-radius: 13px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.bd-swatch b { font-size: 11px; color: var(--muted); font-weight: 600; }
.bd-swatch .mono { font-size: 10.5px; color: #B8B6AD; }
.bd-two { display: flex; gap: 24px; }
.bd-two > div:first-child { flex: 1; }
.bd-two > div:last-child { flex: 1.4; }
.bd-font { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.bd-font-lbl { font-size: 11px; color: var(--muted); }
.bd-font-val { font-size: 17px; font-weight: 700; }
.bd-voice { width: 100%; min-height: 90px; border: 1px solid var(--border-2); border-radius: 11px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: var(--text); background: var(--surface-3); }
.bd-foot { display: flex; align-items: center; gap: 12px; padding-top: 6px; border-top: 1px solid var(--border-3); }
.bd-foot span { font-size: 12.5px; color: var(--muted); flex: 1; }

/* ── Templates page ────────────────────────────────────── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 18px; }
.tpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; overflow: hidden; display: flex; flex-direction: column; }
.tpl-thumb { height: 150px; background-size: cover; background-position: center; position: relative; }
.tpl-badge { position: absolute; top: 11px; left: 11px; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.9); color: #55534C; }
.tpl-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.tpl-name { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-foot { display: flex; align-items: center; gap: 8px; }
.tpl-slides { font-size: 11px; color: var(--muted-3); }

/* responsivo */
@media (max-width: 1000px) {
  .home-cols, .cal-cols, .brands-cols { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Status menu (trocar status na lista) */
.status-menu { position: fixed; z-index: 3600; background: var(--surface); border: 1px solid var(--border-2); border-radius: 11px; box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 168px; animation: rise .12s ease both; }
.status-opt { display: flex; align-items: center; gap: 9px; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-family: inherit; color: var(--text); text-align: left; }
.status-opt:hover { background: var(--subtle); }
.status-opt.active { font-weight: 700; }
.status-opt .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Botão excluir template (aparece no hover) */
.tpl-del { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border: none; border-radius: 8px; background: rgba(255,255,255,.85); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--duration); }
.tpl-card:hover .tpl-del { opacity: 1; }
.tpl-del:hover { background: var(--red-dim); }
