/* ═══════════════════════════════════════════════
   BMM OS — STYLES
   ═══════════════════════════════════════════════ */

.hidden { display: none !important; }

:root {
  /* Brand palette — Analytics Dashboard */
  --purple:       #3B82F6;
  --purple-light: #60A5FA;
  --purple-dim:   rgba(59,130,246,0.12);
  --pink:         #6366F1;
  --pink-dim:     rgba(99,102,241,0.12);
  --cyan:         #06B6D4;
  --cyan-dim:     rgba(6,182,212,0.10);
  --green:        #10B981;
  --green-dim:    rgba(16,185,129,0.10);
  --orange:       #F59E0B;
  --orange-dim:   rgba(245,158,11,0.10);
  --yellow:       #FBBF24;
  --yellow-dim:   rgba(251,191,36,0.10);
  --red:          #EF4444;

  /* Backgrounds — OLED Deep */
  --bg:        #030712;
  --surface:   #0F172A;
  --surface2:  #1E293B;
  --surface3:  #334155;
  --border:    rgba(148,163,184,0.08);
  --border-hi: rgba(148,163,184,0.16);

  /* Text — high contrast */
  --text:       #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim:   #475569;

  /* Layout */
  --header-h:   60px;
  --ai-bar-h:   auto;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(148,163,184,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(148,163,184,0.06);
  --glow-purple: 0 0 24px rgba(59,130,246,0.2);
  --glow-pink:   0 0 24px rgba(99,102,241,0.2);
  --glow-cyan:   0 0 24px rgba(6,182,212,0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Focus visible — accessibility */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── App shell ── */
.app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* ── Main column (right of sidebar) ── */
.main-column {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* ── Pages ── */
.page { display: flex; flex-direction: column; flex: 1; }
.page.hidden { display: none; }

/* ═══════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand-logo { height: 28px; width: auto; }
.sidebar-brand-text { font-weight: 400; letter-spacing: -0.02em; }
.sidebar-brand-text strong { font-weight: 800; }

.sidebar-section-label {
  padding: 16px 16px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: left;
  width: 100%;
  white-space: nowrap;
  position: relative;
}
.sidebar-nav-item:hover {
  background: rgba(59,130,246,0.04);
  color: var(--text);
}
.sidebar-nav-item.active {
  background: var(--purple-dim);
  color: var(--purple-light);
  border-color: rgba(59,130,246,0.15);
  font-weight: 600;
}
.sidebar-nav-item svg { flex-shrink: 0; opacity: 0.55; transition: opacity var(--duration-fast); }
.sidebar-nav-item:hover svg { opacity: 0.85; }
.sidebar-nav-item.active svg { opacity: 1; }

/* ── CRM Nav Box ── */
.crm-nav-box {
  background: rgba(59,130,246,0.03);
  border: 1px solid rgba(59,130,246,0.08);
  border-radius: 10px;
  padding: 4px 4px;
  margin: 0 4px;
  gap: 1px;
}

/* ── Playbook Sidebar Tree ── */
.pb-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 4px 6px 14px;
}
.pb-nav-tree.hidden { display: none; }

.pb-nav-folder-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}
.pb-nav-folder-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pb-nav-folder-header svg { flex-shrink: 0; opacity: 0.6; }
.pb-nav-folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-nav-folder-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 1px 3px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}
.pb-nav-folder-header:hover .pb-nav-folder-del { opacity: 0.6; }
.pb-nav-folder-del:hover { opacity: 1 !important; color: var(--pink); }

.pb-nav-doc-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  overflow: hidden;
}
.pb-nav-doc-row:hover { background: rgba(59,130,246,0.06); }
.pb-nav-doc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: left;
  overflow: hidden;
  border-radius: 6px;
}
.pb-nav-doc-btn:hover { color: var(--text); }
.pb-nav-doc-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.pb-nav-doc-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  padding-right: 4px;
}
.pb-nav-doc-row:hover .pb-nav-doc-actions { opacity: 1; }
.pb-nav-order-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
}
.pb-nav-order-btn:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.pb-nav-order-btn:disabled { opacity: 0.25; cursor: default; }

.pb-nav-actions {
  display: flex;
  gap: 4px;
  padding: 6px 4px 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.pb-nav-add-folder-btn,
.pb-nav-add-doc-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.7rem;
  padding: 4px 7px;
  border-radius: 5px;
  transition: all 0.15s;
}
.pb-nav-add-folder-btn:hover,
.pb-nav-add-doc-btn:hover { background: var(--surface2); color: var(--text); }

.sidebar-footer {
  margin-top: auto;
  padding-bottom: 12px;
  border-top: 1px solid var(--border);
  padding: 8px;
}

/* ═══════════════════════════════════
   BRAND PROFILE — SIDEBAR BUTTON
   ═══════════════════════════════════ */
.sidebar-profile-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 8px 8px 4px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.12);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
}
.sidebar-profile-wrapper:hover {
  border-color: rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.1);
}
.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  text-align: left;
  color: var(--text);
  font-family: inherit;
}
.sidebar-profile-chevron-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  background: none;
  border: none;
  border-left: 1px solid rgba(59,130,246,0.12);
  cursor: pointer;
  color: var(--text-dim);
  opacity: 0.5;
  transition: opacity var(--duration-fast), background var(--duration-fast);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
}
.sidebar-profile-chevron-btn:hover {
  opacity: 1;
  background: rgba(59,130,246,0.15);
}
.sidebar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-profile-info {
  flex: 1;
  min-width: 0;
}
.sidebar-profile-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 1px;
}
.sidebar-profile-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Brand Switcher Dropdown */
.brand-switcher-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg, #1e2030);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.brand-switcher-dropdown.hidden { display: none; }
.brand-switcher-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--duration-fast);
  position: relative;
}
.brand-switcher-item:hover { background: rgba(59,130,246,0.1); }
.brand-switcher-item.active { background: rgba(59,130,246,0.08); }
.brand-switcher-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.brand-switcher-add .brand-switcher-avatar {
  background: rgba(59,130,246,0.15);
  color: var(--purple-light);
  font-size: 1rem;
}
.brand-switcher-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-switcher-check {
  color: var(--green);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.brand-switcher-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast), color var(--duration-fast);
  padding: 0 2px;
  line-height: 1;
}
.brand-switcher-item:hover .brand-switcher-delete { opacity: 0.6; }
.brand-switcher-delete:hover { opacity: 1 !important; color: var(--red); }
.brand-switcher-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 6px;
}

/* ═══════════════════════════════════
   PLAYBOOK CRM — PAGE
   ═══════════════════════════════════ */
.pb-page-wrap {
  padding: 36px 32px 80px;
}
.pb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.pb-page-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pb-page-icon {
  font-size: 2rem;
  line-height: 1;
}
.pb-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}
.pb-page-subtitle {
  font-size: 0.77rem;
  color: var(--text-dim);
}
.pb-page-subtitle code {
  font-size: 0.73rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--purple-light);
  font-family: 'Courier New', monospace;
}

/* Folder tabs row */
.pb-folder-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 0;
  overflow-x: auto;
}
.pb-folder-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}
.pb-folder-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.pb-folder-tab:hover { color: var(--text); }
.pb-folder-tab.active {
  color: var(--purple-light);
  border-bottom-color: var(--purple);
  font-weight: 600;
}
.pb-folder-tab.pb-folder-tab-edit {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pb-folder-tab-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.6rem;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.pb-folder-tab:hover .pb-folder-tab-del { opacity: 0.7; }
.pb-folder-tab-del:hover { color: var(--pink); opacity: 1 !important; }

.pb-add-folder-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.76rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pb-add-folder-btn:hover { background: var(--surface2); color: var(--text); }

/* Document list */
.pb-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pb-doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.pb-doc-row:hover {
  border-color: rgba(59,130,246,0.3);
  background: var(--surface2);
}
.pb-doc-row-cover {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pb-doc-row-icon { font-size: 1.2rem; }
.pb-doc-row-info { flex: 1; min-width: 0; }
.pb-doc-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-doc-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-doc-folder-badge {
  font-size: 0.66rem;
  background: rgba(59,130,246,0.12);
  color: var(--purple-light);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 99px;
  padding: 1px 7px;
  font-weight: 600;
}
.pb-doc-var {
  font-size: 0.7rem;
  font-family: 'Courier New', monospace;
  color: var(--text-dim);
}
.pb-doc-row-open {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-doc-row-open:hover { background: var(--surface3); color: var(--text); }

/* Empty state */
.pb-page-empty {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pb-page-empty p { margin: 0; font-size: 0.88rem; line-height: 1.6; max-width: 420px; }
.pb-page-empty code {
  font-size: 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--purple-light);
  font-family: 'Courier New', monospace;
}

/* Folder select in playbook editor topbar */
.pb-folder-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  padding: 4px 8px;
  cursor: pointer;
  max-width: 130px;
}
.pb-folder-select:focus { outline: none; border-color: var(--purple); }

/* ═══════════════════════════════════
   BRAND PAGE — DOCUMENTO GRID
   ═══════════════════════════════════ */
.brand-page-wrap {
  padding: 36px 32px 80px;
}
.brand-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-page-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-page-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.brand-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.brand-page-profile-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--purple-light);
}
.brand-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}
/* Card */
.brand-doc-card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.brand-doc-card:hover {
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(59,130,246,0.1);
}
.brand-doc-card:focus { outline: 2px solid var(--purple); outline-offset: 2px; }
.brand-doc-cover {
  height: 130px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px;
}
.brand-doc-icon {
  position: absolute;
  left: 16px;
  bottom: -18px;
  font-size: 2.2rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.brand-doc-cover-edit-btn {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  backdrop-filter: blur(8px);
}
.brand-doc-card:hover .brand-doc-cover-edit-btn { opacity: 1; }
.brand-doc-cover-edit-btn:hover { background: rgba(0,0,0,0.7); }
.brand-doc-card-body {
  padding: 26px 16px 16px;
}
.brand-doc-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-doc-card-var {
  font-size: 0.68rem;
  color: var(--purple-light);
  font-family: 'Courier New', monospace;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-doc-card-date {
  font-size: 0.65rem;
  color: var(--text-dim);
}
/* Empty state */
.brand-page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 14px;
  text-align: center;
}
.brand-page-empty p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.65;
}
.brand-page-empty code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.82rem;
  color: var(--purple-light);
  font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════
   BRAND EDITOR — OVERLAY TELA CHEIA
   ═══════════════════════════════════ */
.brand-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.brand-editor-overlay.hidden { display: none; }

/* Topbar */
.brand-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.brand-editor-back {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-editor-back:hover { border-color: var(--purple); color: var(--purple-light); }
.brand-editor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}
.brand-editor-updated-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.autosave-status {
  font-size: 0.7rem;
  color: #10B981;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.autosave-status.visible {
  opacity: 1;
}
.brand-var-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: var(--surface2);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: 'Courier New', monospace;
  color: var(--purple-light);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-copy-btn:hover { border-color: var(--purple); color: var(--purple-light); }
.brand-editor-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}
.brand-delete-btn {
  color: var(--red) !important;
  border-color: rgba(239,68,68,0.25) !important;
}
.brand-delete-btn:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: var(--red) !important;
}

/* Scrollable */
.brand-editor-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Cover */
.brand-editor-cover-section {
  height: 220px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 20px 24px;
  gap: 10px;
  background: linear-gradient(135deg, #2563EB, #6366F1);
  transition: background 0.3s;
}
.brand-cover-change-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.92);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  backdrop-filter: blur(8px);
}
.brand-cover-change-btn:hover { background: rgba(0,0,0,0.65); }
.brand-cover-picker {
  position: absolute;
  bottom: -8px;
  left: 24px;
  transform: translateY(100%);
  z-index: 200;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  width: 310px;
}
.brand-cover-picker.hidden { display: none; }
.cover-swatch {
  width: 46px;
  height: 32px;
  border-radius: 7px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.cover-swatch:hover { border-color: rgba(255,255,255,0.5); transform: scale(1.06); }
.cover-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }

/* Doc area */
.brand-editor-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 40px 120px;
  width: 100%;
}
.brand-editor-icon-wrap {
  margin-bottom: 12px;
  margin-top: -10px;
}
.brand-editor-icon {
  display: inline-block;
  font-size: 3.6rem;
  line-height: 1;
  cursor: text;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s;
  min-width: 72px;
  min-height: 72px;
}
.brand-editor-icon:focus { outline: 2px solid var(--purple); outline-offset: 3px; }
.brand-editor-icon:hover:not(:focus) { background: var(--surface2); }
.brand-editor-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
  padding: 4px 0;
  outline: none;
  cursor: text;
  word-break: break-word;
}
.brand-editor-title:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
  font-weight: 300;
}
.brand-editor-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.brand-editor-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Document metadata section */
.doc-metadata-section {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.doc-metadata-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.doc-metadata-toggle:hover {
  color: var(--text);
  background: var(--surface2);
}
.doc-metadata-chevron {
  font-size: 0.6rem;
  transition: transform var(--duration-fast) var(--ease-out);
}
.doc-metadata-fields {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
}
.doc-metadata-fields.hidden {
  display: none;
}
.doc-metadata-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.doc-metadata-input {
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.doc-metadata-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.doc-metadata-input::placeholder {
  color: var(--text-dim);
}
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.7rem;
  border-radius: 6px;
  font-weight: 600;
}

/* AI context pills */
.ai-context-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 2px;
}
.ai-context-pills.hidden {
  display: none;
}
.ai-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--purple-dim);
  color: var(--purple-light);
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ai-context-pill svg {
  opacity: 0.7;
}
.ai-context-pill.consulting {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  animation: consultPulse 1.5s ease-in-out infinite;
}
@keyframes consultPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-context-pill.consulting { animation: none; }
}

/* Content editor */
.brand-editor-content {
  outline: none;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 320px;
  caret-color: var(--purple-light);
  word-break: break-word;
}
.brand-editor-content:empty::before {
  content: 'Escreva aqui... ou digite / para inserir um bloco';
  color: var(--text-dim);
  pointer-events: none;
  display: block;
}

/* — block styles inside editor — */
.brand-editor-content h1 { font-size: 1.9rem; font-weight: 800; margin: 28px 0 8px; line-height: 1.2; }
.brand-editor-content h2 { font-size: 1.4rem; font-weight: 700; margin: 22px 0 6px; line-height: 1.3; }
.brand-editor-content h3 { font-size: 1.1rem; font-weight: 700; margin: 18px 0 4px; color: var(--text-muted); }
.brand-editor-content p { margin: 0 0 2px; }
.brand-editor-content ul, .brand-editor-content ol { padding-left: 26px; margin: 8px 0; }
.brand-editor-content li { margin-bottom: 3px; }
.brand-editor-content blockquote {
  border-left: 4px solid var(--purple);
  padding-left: 16px;
  margin: 14px 0;
  color: var(--text-muted);
  font-style: italic;
}
.brand-editor-content hr,
.brand-editor-content .brand-divider hr {
  border: none;
  border-top: 1px solid var(--border-hi);
  margin: 22px 0;
}
.brand-editor-content .brand-divider { margin: 22px 0; }

/* Banner */
.brand-editor-content .brand-banner {
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  overflow: hidden;
}
.brand-editor-content .brand-banner-content {
  padding: 12px 16px;
  min-height: 44px;
  outline: none;
}
.brand-editor-content .brand-banner-content p { margin: 0; }
.brand-editor-content .brand-banner-content:focus { background: rgba(255,255,255,0.02); }

/* Columns */
.brand-editor-content .brand-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0;
}
.brand-editor-content .brand-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 64px;
  outline: none;
}
.brand-editor-content .brand-col:focus { border-color: rgba(59,130,246,0.45); }
.brand-editor-content .brand-col p { margin: 0; }

/* Toggle */
.brand-editor-content details.brand-toggle { margin: 10px 0; border-radius: var(--radius-sm); }
.brand-editor-content details.brand-toggle > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  user-select: none;
  outline: none;
}
.brand-editor-content details.brand-toggle > summary::-webkit-details-marker { display: none; }
.brand-editor-content details.brand-toggle > summary::before {
  content: '▶';
  font-size: 0.58rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.brand-editor-content details.brand-toggle[open] > summary::before { transform: rotate(90deg); }
.brand-editor-content .brand-toggle-body {
  padding: 8px 14px 8px 30px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
}
.brand-editor-content .brand-toggle-body:focus { background: rgba(255,255,255,0.01); }

/* Table */
.brand-editor-content .brand-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.92rem;
}
.brand-editor-content .brand-table th,
.brand-editor-content .brand-table td {
  border: 1px solid var(--border-hi);
  padding: 8px 14px;
  min-width: 80px;
  text-align: left;
  outline: none;
}
.brand-editor-content .brand-table th {
  background: var(--surface2);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.brand-editor-content .brand-table td:focus,
.brand-editor-content .brand-table th:focus { background: var(--purple-dim); }

/* ═══════════════════════════════════
   SLASH COMMAND PALETTE
   ═══════════════════════════════════ */
.slash-palette {
  position: fixed;
  z-index: 3000;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 270px;
  max-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.slash-palette.hidden { display: none; }
.slash-palette-search {
  padding: 8px 12px 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
  min-height: 0;
}
.slash-palette-list { overflow-y: auto; padding: 4px; flex: 1; }
.slash-palette-group {
  padding: 7px 10px 3px;
  font-size: 0.59rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
}
.slash-cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: background 0.1s;
}
.slash-cmd-item:hover, .slash-cmd-item.active { background: var(--purple-dim); }
.slash-cmd-icon {
  width: 30px;
  height: 30px;
  background: var(--surface3);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
}
.slash-cmd-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.slash-cmd-label { font-size: 0.83rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.slash-cmd-desc { font-size: 0.66rem; color: var(--text-dim); white-space: nowrap; }

/* ═══════════════════════════════════
   INLINE FORMATTING TOOLBAR
   ═══════════════════════════════════ */
.inline-toolbar {
  position: fixed;
  z-index: 3000;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
}
.inline-toolbar.hidden { display: none; }
.inline-tool-btn {
  width: 30px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  transition: all 0.12s;
}
.inline-tool-btn:hover { background: var(--surface3); border-color: var(--border); }
.inline-toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.inline-color-wrapper { position: relative; }
.inline-color-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.inline-color-panel.hidden { display: none; }
.inline-color-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.12s;
}
.color-swatch:hover { border-color: rgba(255,255,255,0.5); transform: scale(1.15); }

/* ═══════════════════════════════════
   HEADER
   ═══════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(3,7,18,0.82);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ds-toggle-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: none; background: transparent;
  color: var(--text-muted); font-size: 0.73rem; font-family: inherit;
  cursor: pointer; transition: all 0.18s;
}
.ds-toggle-btn:hover { background: var(--surface2); color: var(--text); }
.ds-toggle-btn.active {
  background: var(--purple-dim); color: var(--purple-light);
  font-weight: 600;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.logo-text { font-weight: 400; }
.logo-text strong { font-weight: 800; }

.connection-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot.demo { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.status-dot.connected { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.status-dot.error { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.date-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.date-picker-wrapper:hover { border-color: var(--border-hi); }
.date-picker-wrapper input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  width: 180px;
}

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-ghost:hover { border-color: rgba(59,130,246,0.3); color: var(--purple-light); background: rgba(59,130,246,0.06); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.btn-icon:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface3); }

.btn-primary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 38px;
  background: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-normal);
  box-shadow: 0 1px 3px rgba(59,130,246,0.3);
}
.btn-primary:hover { background: #2563EB; box-shadow: 0 4px 12px rgba(59,130,246,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); box-shadow: 0 1px 3px rgba(59,130,246,0.2); }

/* ═══════════════════════════════════
   AI BAR
   ═══════════════════════════════════ */
.ai-bar {
  background: linear-gradient(180deg, rgba(59,130,246,0.04) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px 10px;
}

.ai-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

.ai-icon-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 10px;
  color: var(--purple-light);
}

.ai-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  border: 1.5px solid var(--purple);
  opacity: 0.5;
  animation: aiPulse 2.5s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0; }
}

.ai-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.ai-input-group:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.ai-input-group input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 10px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}
.ai-input-group input::placeholder { color: var(--text-dim); }

.ai-submit {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--purple);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.ai-submit:hover { background: #2563EB; }

.ai-key-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.ai-key-btn:hover { border-color: var(--yellow); color: var(--yellow); }

.ai-response {
  max-width: 1100px;
  margin: 10px auto 0;
  animation: slideDown 0.3s ease;
}
.ai-response.hidden { display: none; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-response-inner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}
.ai-response-icon { flex-shrink: 0; font-size: 1rem; }

.ai-suggestions {
  max-width: 1100px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-suggestion-label { font-size: 0.72rem; color: var(--text-dim); font-weight: 500; white-space: nowrap; }

.ai-chip {
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ai-chip:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-dim); }

/* ═══════════════════════════════════
   MAIN
   ═══════════════════════════════════ */
.main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ═══════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════ */
.kpi-section {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-color, var(--purple));
  opacity: 0.8;
}
.kpi-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.neutral { color: var(--text-muted); }

.kpi-sparkline {
  height: 32px;
  flex: 1;
  max-width: 80px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--kpi-color-dim, var(--purple-dim));
  flex-shrink: 0;
}

/* ═══════════════════════════════════
   CHART CARDS
   ═══════════════════════════════════ */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal);
}
.chart-card:hover { border-color: var(--border-hi); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chart-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
}
.chart-select:focus { border-color: var(--purple); }

.chart-canvas-wrap {
  position: relative;
  width: 100%;
}

/* ── Charts layout ── */
.charts-row-1,
.charts-row-2 {
  display: grid;
  gap: 20px;
}
.charts-row-1 { grid-template-columns: 2fr 1fr; }
.charts-row-2 { grid-template-columns: 2fr 1fr; }
.col-2 { /* inherits from grid */ }

/* ═══════════════════════════════════
   FUNNEL CHART
   ═══════════════════════════════════ */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.funnel-bar-outer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.funnel-bar-track {
  flex: 1;
  height: 36px;
  background: var(--surface3);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: width 0.8s cubic-bezier(0.34,1.3,0.64,1);
  min-width: 40px;
}

.funnel-bar-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}

.funnel-stats {
  display: flex;
  justify-content: space-between;
  padding: 0 0 0 2px;
}

.funnel-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.funnel-value {
  font-size: 0.7rem;
  color: var(--text);
  font-weight: 700;
}

.funnel-pct {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.funnel-arrow {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 1px 0;
}

/* ═══════════════════════════════════
   HEATMAP (ApexCharts overrides)
   ═══════════════════════════════════ */
#heatmapChart .apexcharts-canvas { background: transparent !important; }

/* ═══════════════════════════════════
   CAMPAIGNS TABLE
   ═══════════════════════════════════ */
.campaigns-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.section-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.campaigns-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.campaigns-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 34px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--purple); color: var(--text); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  width: 180px;
}
.search-box input::placeholder { color: var(--text-dim); }

.filter-select {
  height: 34px;
  padding: 0 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--purple); }

.table-wrapper {
  overflow-x: auto;
}

.campaigns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.campaigns-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
  position: sticky;
  top: 0;
}

.campaigns-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.campaigns-table thead th.sortable:hover { color: var(--purple-light); }
.campaigns-table thead th.active-sort { color: var(--purple-light); }
.sort-icon { opacity: 0.4; font-size: 0.7rem; }
.active-sort .sort-icon { opacity: 1; }

.campaigns-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-out);
}
.campaigns-table tbody tr:last-child { border-bottom: none; }
.campaigns-table tbody tr:nth-child(even) { background: rgba(148,163,184,0.015); }
.campaigns-table tbody tr:hover { background: rgba(59,130,246,0.04); }

.campaigns-table td {
  padding: 13px 16px;
  vertical-align: middle;
  white-space: nowrap;
}

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

.td-campaign { display: flex; flex-direction: column; gap: 3px; }
.campaign-name { font-weight: 600; color: var(--text); }
.campaign-subject { font-size: 0.72rem; color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.td-metric { font-weight: 700; color: var(--text); }
.td-pct { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.metric-pair { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-newsletter    { background: var(--purple-dim); color: var(--purple-light); }
.badge-promocional   { background: var(--pink-dim); color: var(--pink); }
.badge-transacional  { background: var(--cyan-dim); color: var(--cyan); }
.badge-reengajamento { background: var(--orange-dim); color: var(--orange); }

.roi-positive { color: var(--green); font-weight: 700; }
.roi-negative { color: var(--red); font-weight: 700; }

.rate-bar-cell { min-width: 90px; }
.rate-bar-wrap { display: flex; align-items: center; gap: 7px; }
.rate-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
}
.rate-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ── Pagination ── */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

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

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover { border-color: rgba(59,130,246,0.3); color: var(--purple-light); }
.page-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(59,130,246,0.25); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════════════════════════════════
   MODALS
   ═══════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(148,163,184,0.06);
  animation: modalSlide var(--duration-normal) var(--ease-spring);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

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

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.form-group input,
.form-group select {
  height: 38px;
  padding: 0 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }

.field-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }

.badge-optional {
  padding: 2px 8px;
  background: var(--yellow-dim);
  color: var(--yellow);
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.modal-info {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.modal-info ol { padding-left: 16px; }
.modal-info li { margin-bottom: 4px; }
.modal-info strong { color: var(--text); }
.modal-note { margin-top: 8px; font-size: 0.72rem; color: var(--text-dim); }

.import-status {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}
.import-status.loading { background: var(--purple-dim); color: var(--purple-light); }
.import-status.success { background: var(--green-dim); color: var(--green); }
.import-status.error   { background: var(--pink-dim);  color: var(--pink); }
.import-status.hidden  { display: none; }

/* ═══════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton { animation: none; background: var(--surface2); }
}

/* ═══════════════════════════════════
   FLATPICKR OVERRIDES
   ═══════════════════════════════════ */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text) !important;
  font-family: 'Inter', sans-serif !important;
}
.flatpickr-day { color: var(--text-muted) !important; border-radius: 7px !important; }
.flatpickr-day:hover { background: var(--surface2) !important; color: var(--text) !important; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #fff !important;
}
.flatpickr-day.inRange {
  background: var(--purple-dim) !important;
  border-color: transparent !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.flatpickr-months { background: var(--surface) !important; }
.flatpickr-month, .flatpickr-weekday, .flatpickr-prev-month, .flatpickr-next-month {
  color: var(--text-muted) !important;
  fill: var(--text-muted) !important;
}
.flatpickr-current-month { color: var(--text) !important; font-weight: 700 !important; }
.numInput { color: var(--text) !important; background: var(--surface2) !important; }

/* ═══════════════════════════════════
   APEXCHARTS GLOBAL OVERRIDES
   ═══════════════════════════════════ */
.apexcharts-tooltip {
  background: var(--surface2) !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
  color: var(--text) !important;
  font-family: 'Inter', sans-serif !important;
}
.apexcharts-tooltip-title {
  background: var(--surface3) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
}
.apexcharts-xaxistooltip {
  background: var(--surface2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ═══════════════════════════════════
   TABS
   ═══════════════════════════════════ */
.tab-nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--surface2); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(99,102,241,0.1));
  color: var(--text);
  font-weight: 700;
  border-color: rgba(59,130,246,0.35);
}

.tab-panel { display: flex; flex-direction: column; gap: 20px; }
.tab-panel.hidden { display: none; }

/* ═══════════════════════════════════
   PERIOD CARDS
   ═══════════════════════════════════ */
.period-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.period-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal);
}
.period-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--period-color, var(--purple));
  opacity: 0.7;
}
.period-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

.period-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.period-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--period-color, var(--purple));
}
.period-card-sublabel {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.period-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.period-card-stats { display: flex; flex-direction: column; gap: 0; }

.period-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.period-stat:last-child { border-bottom: none; padding-bottom: 0; }
.period-stat:first-child { padding-top: 0; }

.period-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.period-stat-value {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════
   KPI COMPARISON GRID
   ═══════════════════════════════════ */
.kpi-comp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 4px 0;
}

.kpi-comp-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.kpi-comp-item:hover { border-color: var(--border-hi); }

.kpi-comp-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.kpi-comp-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.kpi-delta-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.kpi-delta-hint { color: var(--text-dim); font-weight: 400; font-size: 0.65rem; }

.delta-up     { color: var(--green); }
.delta-down   { color: var(--red); }
.delta-neutral { color: var(--text-muted); }

.kpi-comp-bars-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kpi-comp-bar { display: flex; flex-direction: column; gap: 4px; }

.kpi-comp-bar-period {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-comp-bar-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.kpi-comp-bar-track {
  height: 5px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.kpi-comp-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(0.34, 1.1, 0.64, 1);
  min-width: 3px;
}

/* ═══════════════════════════════════
   PERIOD CAMPAIGNS
   ═══════════════════════════════════ */
.period-campaigns-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.period-camp-list { display: flex; flex-direction: column; gap: 8px; }

.period-camp-item {
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.period-camp-item:hover { border-color: var(--border-hi); }

.period-camp-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.period-camp-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.period-camp-metrics { display: flex; gap: 16px; }
.period-camp-metric { display: flex; flex-direction: column; gap: 2px; }
.period-camp-metric-label {
  font-size: 0.58rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.period-camp-metric-value { font-size: 0.78rem; font-weight: 700; }

.no-data-msg {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 24px 0;
  text-align: center;
}

/* ═══════════════════════════════════
   PLANNING PAGE
   ═══════════════════════════════════ */

.planning-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
  flex-wrap: wrap;
}

.planning-page-title-group { display: flex; flex-direction: column; gap: 4px; }

.planning-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.planning-page-title svg { flex-shrink: 0; -webkit-text-fill-color: var(--purple-light); color: var(--purple-light); }

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

.planning-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Prompt Library tab header ── */
.prompt-lib-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
}

/* ── Prompt Library ── */
.prompt-lib-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
  flex-wrap: wrap;
}

.prompt-lib-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 560px;
}

.prompt-lib-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Flowchart */
.prompt-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 40px;
  gap: 0;
}

.prompt-flow-item {
  width: 100%;
  max-width: 660px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  position: relative;
}
.prompt-flow-item:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.prompt-flow-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prompt-flow-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--purple-light);
  flex-shrink: 0;
}

.prompt-flow-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.prompt-status-badge {
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-rascunho   { background: rgba(245,158,11,0.18); color: var(--orange); border: 1px solid rgba(245,158,11,0.3); }
.status-aprovado   { background: rgba(16,185,129,0.15);  color: #10B981;       border: 1px solid rgba(16,185,129,0.3); }
.status-depreciado { background: var(--surface2);      color: var(--text-dim); border: 1px solid var(--border); }

.prompt-flow-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.prompt-flow-item-notes {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-flow-item-preview {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.prompt-flow-item-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.prompt-flow-item:hover .prompt-flow-item-actions { opacity: 1; }

.prompt-flow-move-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.12s;
}
.prompt-flow-move-btn:hover { background: var(--surface3); color: var(--text); }

.prompt-flow-connector {
  width: 2px;
  height: 28px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
}
.prompt-flow-connector::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border);
}

/* ── Prompt Editor Overlay ── */
.prompt-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.prompt-editor-overlay.hidden { display: none; }

.prompt-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.prompt-editor-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.prompt-editor-back:hover { color: var(--text); background: var(--surface2); }

.prompt-editor-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.prompt-updated-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.prompt-status-select {
  height: 30px;
  padding: 0 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.prompt-status-select:focus { border-color: var(--purple); }

.prompt-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prompt-delete-btn {
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.prompt-delete-btn:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--red);
}

.prompt-editor-scroll {
  flex: 1;
  overflow-y: auto;
}

.prompt-editor-doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

.prompt-editor-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  outline: none;
  line-height: 1.25;
  margin-bottom: 28px;
}
.prompt-editor-title:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
}

.prompt-editor-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 8px;
  margin-top: 24px;
}

.prompt-notes-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.prompt-notes-input:focus { border-color: var(--purple); }

.prompt-editor-hint {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}
.prompt-editor-hint code {
  font-family: 'Courier New', monospace;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--purple-light);
  font-size: 0.8em;
}

.prompt-content-input {
  width: 100%;
  min-height: 240px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.prompt-content-input:focus { border-color: var(--purple); }

/* ── Gerar Planejamento Modal ── */
.gerar-plan-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2200;
  backdrop-filter: blur(2px);
}
.gerar-plan-backdrop.hidden { display: none; }

.gerar-plan-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2201;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gerar-plan-modal.hidden { display: none; }

.gerar-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gerar-plan-header-left { flex: 1; min-width: 0; }

.gerar-plan-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.gerar-plan-title svg { color: var(--purple-light); flex-shrink: 0; }

.gerar-plan-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.gerar-plan-header-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.gerar-plan-step-badge {
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--purple-dim);
  color: var(--purple-light);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}
.gerar-plan-step-badge.hidden { display: none; }

.gerar-plan-minimize,
.gerar-plan-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
  font-family: inherit;
  line-height: 1;
}
.gerar-plan-minimize:hover { color: var(--text); background: var(--surface2); }
.gerar-plan-close:hover    { color: var(--text); background: var(--surface2); }

/* ── Gerar Plan Floating Pill ── */
.gerar-plan-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid rgba(59,130,246,0.55);
  border-radius: 99px;
  padding: 7px 6px 7px 14px;
  box-shadow: 0 4px 20px rgba(59,130,246,0.25), 0 2px 8px rgba(0,0,0,0.25);
  animation: pill-glow 2.2s ease-in-out infinite;
}
.gerar-plan-pill.hidden { display: none; }
.gerar-plan-pill.done {
  border-color: rgba(16,185,129,0.55);
  box-shadow: 0 4px 20px rgba(16,185,129,0.2), 0 2px 8px rgba(0,0,0,0.2);
  animation: none;
}

.gerar-plan-pill-body {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding-right: 8px;
}
.gerar-plan-pill-body:hover .gerar-plan-pill-text { color: var(--text); }

.gerar-plan-pill-icon {
  color: var(--purple-light);
  flex-shrink: 0;
  animation: pill-icon-pulse 1.4s ease-in-out infinite;
}
.gerar-plan-pill.done .gerar-plan-pill-icon {
  color: #10B981;
  animation: none;
}

.gerar-plan-pill-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s;
}
.gerar-plan-pill.done .gerar-plan-pill-text { color: #10B981; }

.gerar-plan-pill-cancel {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}
.gerar-plan-pill-cancel:hover { background: rgba(239,68,68,0.18); color: var(--red); }
.gerar-plan-pill.done .gerar-plan-pill-cancel { display: none; }

@keyframes pill-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(59,130,246,0.2), 0 2px 8px rgba(0,0,0,0.2); }
  50%       { box-shadow: 0 4px 28px rgba(59,130,246,0.45), 0 2px 8px rgba(0,0,0,0.25); }
}
@keyframes pill-icon-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.2); opacity: 0.6; }
}

.gerar-plan-config {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.gerar-plan-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  white-space: nowrap;
}

.gerar-plan-model-sel {
  height: 30px;
  padding: 0 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.gerar-plan-model-sel:focus { border-color: var(--purple); }

.gerar-plan-prompts-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.gerar-plan-prompts-section .gerar-plan-label { margin-bottom: 10px; }

.gerar-plan-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.gerar-plan-prompt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.gerar-plan-prompt-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--purple-light);
  flex-shrink: 0;
}

.gerar-plan-prompt-name { flex: 1; color: var(--text); font-weight: 500; }

.gerar-plan-progress {
  height: 3px;
  background: var(--surface2);
  flex-shrink: 0;
}
.gerar-plan-progress.hidden { display: none; }

.gerar-plan-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  width: 0%;
  transition: width 0.3s ease;
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Setup wrapper ── */
.gerar-plan-setup { display: flex; flex-direction: column; }
.gerar-plan-setup.hidden { display: none; }

/* ── Typeform ── */
.gerar-plan-typeform { display: flex; flex-direction: column; overflow: hidden; }
.gerar-plan-typeform.hidden { display: none; }

.gp-tf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 4px;
  flex-shrink: 0;
}
.gp-tf-dots { display: flex; gap: 5px; align-items: center; }
.gp-tf-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: all 0.2s;
}
.gp-tf-dot.active { background: var(--purple); width: 18px; border-radius: 99px; }
.gp-tf-dot.done { background: var(--purple-dim); border: 1px solid rgba(59,130,246,0.4); }
.gp-tf-counter { font-size: 0.68rem; font-weight: 700; color: var(--text-dim); }

.gp-tf-card { padding: 10px 20px 0; flex: 1; overflow-y: auto; }
.gp-tf-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px;
}
.gp-tf-qnum-line { display: flex; align-items: center; gap: 5px; }
.gp-tf-qnum { font-size: 0.78rem; font-weight: 800; color: var(--purple-light); }
.gp-tf-arrow { font-size: 0.78rem; color: var(--purple-light); font-weight: 700; }
.gp-tf-delete-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  padding: 2px 4px; border-radius: 4px; display: flex; align-items: center; transition: all 0.12s;
}
.gp-tf-delete-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }

.gp-tf-question {
  font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.4;
  margin-bottom: 6px; outline: none; border-radius: 4px; padding: 2px 4px; margin-left: -4px;
  cursor: text; transition: background 0.12s; min-height: 1.4em;
}
.gp-tf-question:focus { background: var(--surface2); outline: 1px solid var(--purple-dim); }
.gp-tf-question:empty::before { content: 'Clique para editar...'; color: var(--text-dim); pointer-events: none; }

.gp-tf-subtext {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 12px; outline: none; border-radius: 4px; padding: 2px 4px; margin-left: -4px;
  cursor: text; transition: background 0.12s; white-space: pre-wrap; word-break: break-word;
}
.gp-tf-subtext:focus { background: var(--surface2); outline: 1px solid var(--purple-dim); }
.gp-tf-subtext:empty::before { content: 'Clique para editar o subtexto...'; color: var(--text-dim); pointer-events: none; }

.gp-tf-answer {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--surface2); border: 1px solid var(--border);
  border-bottom: 2px solid var(--purple); border-radius: 6px 6px 0 0;
  color: var(--text); font-family: inherit; font-size: 0.88rem;
  padding: 10px 12px; outline: none; line-height: 1.55; min-height: 80px;
  transition: border-color 0.15s;
}
.gp-tf-answer:focus { border-bottom-color: var(--purple-light); }

.gp-tf-ok-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.gp-tf-ok-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s; font-family: inherit;
}
.gp-tf-ok-btn:hover { opacity: 0.85; }
.gp-tf-ok-btn:disabled { opacity: 0.4; cursor: default; }
.gp-tf-ok-hint { font-size: 0.72rem; color: var(--text-dim); }
.gp-tf-ok-hint kbd {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px; font-family: inherit; font-size: 0.7rem;
}

/* Context preview */
.gp-tf-context-wrap {
  margin: 0 20px 4px; border: 1px solid rgba(16,185,129,0.3); border-radius: var(--radius-sm);
  background: rgba(16,185,129,0.04); overflow: hidden;
}
.gp-tf-context-wrap.hidden { display: none; }
.gp-tf-context-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; font-size: 0.72rem; font-weight: 700;
  color: #10B981; border-bottom: 1px solid rgba(16,185,129,0.2);
}
.gp-tf-context-body {
  padding: 10px 12px; font-size: 0.78rem; color: var(--text-muted);
  line-height: 1.55; max-height: 110px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.gp-tf-context-actions {
  padding: 8px 12px; border-top: 1px solid rgba(16,185,129,0.2);
  display: flex; justify-content: flex-end;
}
.gp-tf-continue-btn { font-size: 0.8rem; padding: 6px 16px; }

/* Nav */
.gp-tf-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 14px; flex-shrink: 0; border-top: 1px solid var(--border);
}
.gp-tf-back-btn { font-size: 0.8rem; padding: 5px 10px; visibility: visible; }
.gp-tf-back-btn.hidden { visibility: hidden; }
.gp-tf-nav-right { display: flex; align-items: center; gap: 8px; }
.gp-tf-add-btn {
  display: inline-flex; align-items: center; gap: 5px; background: none;
  border: 1px solid var(--border); color: var(--text-dim); font-size: 0.73rem;
  padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.12s; font-family: inherit;
}
.gp-tf-add-btn:hover { color: var(--text); border-color: var(--purple); background: var(--purple-dim); }
.gp-tf-next-btn { font-size: 0.82rem; padding: 6px 16px; }

/* ── Output (execution) ── */
.gerar-plan-output-wrap {
  display: flex; flex-direction: column; overflow: hidden;
  border-top: 1px solid var(--border);
}
.gerar-plan-output-wrap.hidden { display: none; }
.gerar-plan-output-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim); padding: 8px 18px 4px; flex-shrink: 0;
}
.gerar-plan-output {
  flex: 1; resize: none; background: var(--bg); border: none;
  color: var(--text-muted); font-family: 'Courier New', monospace;
  font-size: 0.74rem; padding: 6px 18px 14px; outline: none;
  line-height: 1.6; min-height: 160px; max-height: 260px;
}

/* ── Chat area ── (kept hidden, no longer used) */
.gerar-plan-chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 360px;
  scroll-behavior: smooth;
}
.gerar-plan-chat.hidden { display: none; }

/* Chat message wrappers */
.gp-msg-ai   { display: flex; gap: 8px; align-self: flex-start; max-width: 90%; }
.gp-msg-user { display: flex; gap: 8px; flex-direction: row-reverse; align-self: flex-end; max-width: 82%; }
.gp-msg-step { align-self: center; }
.gp-msg-status { align-self: stretch; }

/* Chat bubbles */
.gp-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.gp-bubble-ai {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.gp-bubble-user {
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.gp-bubble-step {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gp-bubble-status {
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface2);
}
.gp-bubble-status.success { color: #10B981; border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.07); }
.gp-bubble-status.error   { color: var(--red); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.07); }
.gp-bubble-scripts {
  font-family: 'Courier New', monospace;
  font-size: 0.74rem;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* AI avatar */
.gp-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--purple-light);
  font-weight: 800;
  margin-top: 2px;
}

/* Typing cursor while streaming */
.gp-cursor::after {
  content: '▋';
  animation: gp-blink 0.7s step-end infinite;
  color: var(--purple-light);
  font-size: 0.85em;
}
@keyframes gp-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Chat input row ── */
.gerar-plan-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 14px 6px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.gerar-plan-input-row.hidden { display: none; }
.gerar-plan-textarea {
  flex: 1;
  resize: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.83rem;
  padding: 8px 12px;
  outline: none;
  line-height: 1.45;
  max-height: 100px;
  overflow-y: auto;
}
.gerar-plan-textarea:focus { border-color: var(--purple); }
.gerar-plan-textarea::placeholder { color: var(--text-dim); }
.gerar-plan-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.gerar-plan-send-btn:hover { background: var(--purple-light); }
.gerar-plan-send-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Nav row (Próximo / Gerar Scripts) ── */
.gerar-plan-nav {
  padding: 8px 16px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.gerar-plan-nav.hidden { display: none; }
.gerar-plan-next-btn { font-size: 0.82rem; padding: 7px 16px; }

.gerar-plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
}

.gerar-plan-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
}
.gerar-plan-status.success { color: #10B981; }
.gerar-plan-status.error   { color: var(--red); }

.gerar-plan-footer-btns {
  display: flex;
  gap: 8px;
}

/* ── Script Viewer Modal ── */
.script-viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2300;
  backdrop-filter: blur(2px);
}
.script-viewer-backdrop.hidden { display: none; }

.script-viewer-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2301;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.script-viewer-modal.hidden { display: none; }

.script-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.script-viewer-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.script-viewer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.script-viewer-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 0.12s;
}
.script-viewer-close:hover { color: var(--text); }

.script-viewer-textarea {
  flex: 1;
  min-height: 300px;
  padding: 16px 20px;
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  resize: none;
  outline: none;
}

.script-viewer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* Calendar chip script indicator */
.cal-email-chip.has-script {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.07);
}
.cal-email-chip.has-script .cal-email-chip-title { color: #10B981; }
.cal-script-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
}


/* Goals Section */
.goals-section {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goals-section-header { display: flex; flex-direction: column; gap: 4px; }

.goals-section-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 640px;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

/* Goal Card */
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal), transform var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.goal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--goal-color, var(--purple));
  opacity: 0.7;
}
.goal-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.goal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.goal-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  flex: 1;
}

.goal-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.goal-type-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-manual    { background: rgba(59,130,246,0.2);  color: var(--purple-light); border: 1px solid rgba(59,130,246,0.3); }
.badge-historical { background: rgba(255,145,0,0.15);  color: var(--orange);       border: 1px solid rgba(255,145,0,0.25); }
.badge-calculated { background: rgba(0,229,255,0.12);  color: var(--cyan);          border: 1px solid rgba(0,229,255,0.2); }

/* Info tooltip button */
.goal-info-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.goal-info-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hi);
  color: var(--text-muted);
}

.goal-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 10px 12px;
  background: var(--surface3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: normal;
  text-align: left;
}
.goal-info-btn:hover .goal-tooltip,
.goal-info-btn:focus .goal-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Edit button */
.goal-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.goal-edit-btn:hover {
  background: var(--purple-dim);
  border-color: rgba(59,130,246,0.4);
  color: var(--purple-light);
}
.goal-edit-btn.active {
  background: var(--purple-dim);
  border-color: rgba(59,130,246,0.4);
  color: var(--purple-light);
}

/* Goal value display */
.goal-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--goal-color, var(--purple));
  line-height: 1.1;
  word-break: break-word;
}
.goal-value.not-set {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Goal input row (shown when editing) */
.goal-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.goal-input-row.hidden { display: none; }
.goal-input-row:focus-within { border-color: var(--purple); }

.goal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  width: 0;
  min-width: 0;
}

.goal-input-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.goal-input-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: var(--radius-sm);
  color: var(--purple-light);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
  flex-shrink: 0;
}
.goal-input-confirm:hover { background: rgba(59,130,246,0.35); }

/* Goals detail card (ticket médio info) */
.goals-detail-card {
  margin: 12px 24px 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.goals-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.goals-detail-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.goals-detail-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.goals-detail-value span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ═══════════════════════════════════
   PLANNING MONTH BAR
   ═══════════════════════════════════ */
.planning-month-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.planning-month-bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-select {
  height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.plan-select:focus { border-color: var(--purple); }

/* ═══════════════════════════════════
   CAMPAIGN CALENDAR
   ═══════════════════════════════════ */
.calendar-section {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Outer scroll container */
#calendarTable { overflow-x: auto; }

/* Table wrap (border + radius, no overflow:hidden so tooltips escape) */
.calendar-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 600px;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--surface);
}

/* ── Header ── */
.calendar-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cal-th-date   { width: 80px; }
.cal-th-emails { }
.cal-th-metric { text-align: right; width: 160px; }

/* Header info button (tooltip opens below) */
.cal-header-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
}
.cal-header-info-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hi);
  color: var(--text-muted);
}

.cal-header-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 210px;
  padding: 8px 10px;
  background: var(--surface3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: normal;
  text-align: left;
}
.cal-header-info-btn:hover .cal-header-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ── Rows ── */
.cal-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.cal-row:last-child { border-bottom: none; }
.cal-row:hover { background: rgba(255,255,255,0.025); }
.cal-weekend { background: rgba(255,255,255,0.01); }
.cal-weekend:hover { background: rgba(255,255,255,0.03); }

/* ── Date cell ── */
.cal-date-cell {
  padding: 10px 14px;
  vertical-align: top;
  white-space: nowrap;
  width: 72px;
  border-right: 1px solid var(--border);
}
.cal-day-num {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.cal-day-name {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 3px;
}
.cal-weekend .cal-day-num  { color: var(--text-dim); }
.cal-weekend .cal-day-name { color: var(--text-dim); }

/* ── Emails cell ── */
.cal-emails-cell {
  padding: 8px 14px;
  vertical-align: top;
}
.cal-emails-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Email chip */
.cal-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--purple-light);
  max-width: 320px;
}
.cal-email-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-email-chip-remove {
  background: none;
  border: none;
  color: rgba(59,130,246,0.5);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 1px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.cal-email-chip-remove:hover { color: var(--red); }

/* Add email input row */
.cal-add-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cal-add-row.hidden { display: none; }

.cal-email-input {
  flex: 1;
  height: 28px;
  padding: 0 10px;
  background: var(--surface2);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.cal-email-input:focus  { border-color: var(--purple); }
.cal-email-input::placeholder { color: var(--text-dim); }

.cal-add-confirm,
.cal-add-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all 0.15s;
}
.cal-add-confirm {
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.4);
  color: var(--purple-light);
}
.cal-add-confirm:hover { background: rgba(59,130,246,0.3); }
.cal-add-cancel {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.cal-add-cancel:hover { border-color: var(--red); color: var(--red); }

/* Day action buttons */
.cal-day-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.cal-add-btn,
.cal-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-add-btn:hover {
  background: var(--purple-dim);
  border-color: rgba(59,130,246,0.35);
  color: var(--purple-light);
}
.cal-ai-btn:hover {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.3);
  color: var(--pink);
}

/* ── Metric cells ── */
.cal-metric-cell {
  padding: 10px 14px;
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
  border-left: 1px solid var(--border);
  width: 160px;
}
.cal-metric-empty .cal-empty-dash {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.cal-metric-content {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.cal-metric-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

/* Metric "i" info button (tooltip opens above) */
.cal-metric-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.cal-metric-info-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hi);
  color: var(--text-muted);
}
.cal-metric-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: 200px;
  padding: 8px 10px;
  background: var(--surface3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: normal;
  text-align: left;
}
.cal-metric-info-btn:hover .cal-metric-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 1400px) {
  .goals-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1200px) {
  .kpi-section { grid-template-columns: repeat(4, 1fr); }
  .charts-row-1, .charts-row-2 { grid-template-columns: 1fr; }
  .period-cards-grid { grid-template-columns: 1fr; }
  .kpi-comp-grid { grid-template-columns: 1fr; }
  .period-campaigns-section { grid-template-columns: 1fr; }
  .goals-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  .sidebar-brand-text,
  .sidebar-nav-item span,
  .sidebar-section-label { display: none; }
  .sidebar-brand-logo { height: 22px; }
  .sidebar-nav-item { justify-content: center; padding: 12px; }
  .sidebar-brand { justify-content: center; padding: 16px 8px; }
  .sidebar-profile-wrapper { margin: 8px 4px 4px; }
  .sidebar-profile-btn { justify-content: center; padding: 10px 0; }
  .sidebar-profile-info, .sidebar-profile-chevron-btn { display: none; }
  .main-column { margin-left: 60px; }
  .goals-grid { grid-template-columns: repeat(2, 1fr); }
  .planning-page-header { flex-direction: column; }
}

@media (max-width: 768px) {
  .main { padding: 16px; gap: 16px; }
  .header { padding: 0 16px; }
  .ai-bar { padding: 12px 16px; }
  .kpi-section { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .campaigns-controls { width: 100%; }
  .search-box input { width: 120px; }
  .header-right .btn-ghost span { display: none; }
  .kpi-comp-bars-row { grid-template-columns: 1fr; gap: 6px; }
  .tab-btn span { display: none; }
  .goals-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .goals-section, .planning-page-header, .calendar-section { padding-left: 16px; padding-right: 16px; }
  .goals-detail-card { margin-left: 16px; margin-right: 16px; }
  .planning-month-bar { padding-left: 16px; padding-right: 16px; }
  .cal-th-metric, .cal-metric-cell { width: 120px; }
  .cal-email-chip { max-width: 220px; }
}

@media (max-width: 480px) {
  .kpi-section { grid-template-columns: 1fr 1fr; }
  .ai-suggestions { display: none; }
  .goals-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .goal-value { font-size: 1.1rem; }
}

/* ════════════════════════════════════════════════════════════
   PRODUTOS
   ════════════════════════════════════════════════════════════ */

/* Sidebar badge */
.prod-count-badge {
  margin-left: auto;
  background: rgba(59,130,246,0.18);
  color: var(--purple-light);
  border: 1px solid rgba(59,130,246,0.28);
  border-radius: 99px;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 7px;
}
.prod-count-badge.hidden { display: none; }

/* Page wrap — two-column layout */
.prod-page-wrap {
  padding: 28px 32px 28px 28px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  min-height: 0;
  flex: 1;
}

.prod-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.prod-side-col {
  width: 310px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

/* ── Import Panel ─────────────────────────────────────── */
.prod-import-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.prod-import-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.prod-import-panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.prod-import-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.prod-import-collapse-btn:hover { color: var(--text); }
.prod-import-panel-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prod-import-panel-body.collapsed { display: none; }

.prod-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.prod-url-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.prod-url-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.83rem;
  padding: 8px 12px;
  outline: none;
  box-sizing: border-box;
}
.prod-url-input:focus { border-color: var(--purple); }
.prod-open-url {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 0.79rem;
  white-space: nowrap;
}
.prod-url-hint {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.prod-url-hint kbd {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text);
}
.prod-xml-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.74rem;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  line-height: 1.5;
  min-height: 100px;
}
.prod-xml-input:focus { border-color: var(--purple); }
.prod-import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prod-import-msg {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.prod-import-msg.error { color: var(--pink); }
.prod-import-msg.success { color: #10B981; }

/* ── Grid ─────────────────────────────────────────────── */
.prod-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.prod-grid-header.hidden { display: none; }
.prod-grid-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.prod-grid-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.prod-grid-count {
  font-size: 0.74rem;
  color: var(--text-dim);
}
.prod-search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 7px 12px;
  outline: none;
  width: 230px;
  box-sizing: border-box;
}
.prod-search-input:focus { border-color: var(--purple); }

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

/* Product card */
.prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.prod-card:hover {
  border-color: rgba(59,130,246,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.prod-card-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.prod-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prod-card-img-placeholder {
  font-size: 2.8rem;
  opacity: 0.3;
}
.prod-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.prod-card-name {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-card-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.prod-card-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.prod-card-price.crossed {
  color: var(--text-dim);
  text-decoration: line-through;
  font-weight: 400;
  font-size: 0.72rem;
}
.prod-card-sale-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: #10B981;
}
.prod-card-avail {
  margin-top: auto;
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.69rem;
  color: var(--text-dim);
}
.prod-avail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.prod-avail-dot.in-stock    { background: #10B981; }
.prod-avail-dot.out-stock   { background: #f87171; }
.prod-avail-dot.preorder    { background: #facc15; }

/* Per-card overlay buttons (delete + CP) and checkbox */
.prod-card { position: relative; overflow: visible; }
.prod-card.selected { border-color: rgba(59,130,246,0.55); box-shadow: 0 0 0 2px rgba(59,130,246,0.18); }

/* Checkbox */
.prod-card-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.prod-card:hover .prod-card-check,
.prod-card.selected .prod-card-check { opacity: 1; }
.prod-card-check input[type="checkbox"] { display: none; }
.prod-card-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.prod-card-check input:checked ~ .prod-card-check-box {
  background: var(--purple);
  border-color: var(--purple);
}
.prod-card-check input:checked ~ .prod-card-check-box::after {
  content: '';
  display: block;
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Context Profile button on card */
.prod-card-ctx-btn {
  position: absolute;
  top: 6px;
  right: 32px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(59,130,246,0.15);
  color: var(--purple-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.prod-card:hover .prod-card-ctx-btn { opacity: 1; }
.prod-card-ctx-btn:hover { background: rgba(59,130,246,0.32); }
.prod-card-ctx-btn.has-cp { opacity: 0.6; }
.prod-card:hover .prod-card-ctx-btn.has-cp { opacity: 1; }
.prod-card-ctx-btn:disabled { cursor: default; opacity: 0.4; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; }

/* Delete button */
.prod-card-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(248,113,113,0.15);
  color: #f87171;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.prod-card:hover .prod-card-del-btn { opacity: 1; }
.prod-card-del-btn:hover { background: rgba(248,113,113,0.35); }

/* Bulk action bar */
.prod-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 10px;
  margin-bottom: 12px;
}
.prod-bulk-bar.hidden { display: none; }
.prod-bulk-count { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.prod-bulk-status { font-size: 0.78rem; color: var(--text-dim); }
.prod-bulk-gen-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
}

/* Right sidebar — Context Profile prompt panel */
.prod-ctx-prompt-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid rgba(59,130,246,0.5);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.prod-ctx-prompt-panel-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.prod-ctx-prompt-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: block;
}
.prod-ctx-model-sel {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 6px 8px;
}
.prod-ctx-prompt-editor {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.55;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
}
.prod-ctx-prompt-editor:focus { border-color: var(--purple); }
.prod-ctx-prompt-reset-btn { font-size: 0.73rem; }
.prod-ctx-var-info {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.prod-ctx-var-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.prod-ctx-var-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--purple-light);
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 6px;
  padding: 3px 8px;
}
.prod-ctx-var-desc { font-size: 0.73rem; color: var(--text-dim); margin: 0; line-height: 1.5; }

/* Product variable preview */
.prod-var-preview {
  margin-top: 12px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.prod-var-preview.hidden { display: none; }
.prod-var-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.prod-var-preview-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.prod-var-preview-title code {
  color: var(--purple-light);
  background: var(--purple-dim);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
}
.prod-var-preview-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--duration-fast) var(--ease-out);
}
.prod-var-preview-close:hover { color: var(--text); }
.prod-var-preview-content {
  padding: 12px;
  font-size: 0.7rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* Product modal — Context Profile section */
.prod-modal-ctx-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.prod-modal-ctx-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.prod-modal-ctx-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.prod-modal-ctx-date {
  font-size: 0.68rem;
  color: #10B981;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 99px;
  padding: 1px 7px;
}
.prod-modal-ctx-date.hidden { display: none; }
.prod-modal-ctx-status { font-size: 0.74rem; }
.prod-modal-ctx-status.loading { color: var(--text-dim); }
.prod-modal-ctx-status.success { color: #10B981; }
.prod-modal-ctx-status.error   { color: #f87171; }
.prod-modal-ctx-output-wrap { margin-top: 8px; }
.prod-modal-ctx-output-wrap.hidden { display: none; }
.prod-modal-ctx-output {
  width: 100%;
  box-sizing: border-box;
  height: 140px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
}

/* Delete-all button in grid header */
.prod-delete-all-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #f87171;
  border-color: rgba(248,113,113,0.3);
  white-space: nowrap;
}
.prod-delete-all-btn:hover {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.5);
  color: #f87171;
}

/* Empty state */
.prod-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.prod-empty-state.hidden { display: none; }
.prod-empty-icon { font-size: 3.2rem; margin-bottom: 14px; }
.prod-empty-text { font-size: 0.9rem; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.prod-empty-sub  { font-size: 0.8rem; margin: 0; }

/* ── Produto Modal ──────────────────────────────────────── */
.prod-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.prod-modal-backdrop.hidden { display: none; }

.prod-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
}

.prod-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}
.prod-modal-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.prod-modal-icon { font-size: 1.35rem; flex-shrink: 0; }
.prod-modal-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prod-modal-title-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}
.prod-modal-sku-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
}
.prod-modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.prod-modal-close-btn:hover { color: var(--text); background: var(--surface); }

.prod-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.prod-modal-left {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.prod-modal-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.prod-modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.prod-modal-img-empty { font-size: 3rem; opacity: 0.35; }

.prod-modal-right {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.prod-modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.prod-modal-field-row {
  display: flex;
  gap: 10px;
}
.prod-modal-field-row .prod-modal-field { flex: 1; min-width: 0; }
.prod-modal-field-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prod-modal-label {
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prod-modal-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.prod-modal-input:focus { border-color: var(--purple); }
.prod-modal-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
}
.prod-modal-textarea:focus { border-color: var(--purple); }
.prod-modal-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.prod-modal-select:focus { border-color: var(--purple); }

.prod-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}
.prod-modal-saved-msg {
  font-size: 0.75rem;
  color: #10B981;
  opacity: 0;
  transition: opacity 0.3s;
}
.prod-modal-saved-msg.visible { opacity: 1; }

/* ── Scrap Detalhado ────────────────────────────────────── */
.prod-scrap-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
}
.prod-scrap-divider::before,
.prod-scrap-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.prod-scrap-divider-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.prod-scrap-wrap   { display: flex; flex-direction: column; gap: 8px; }
.prod-scrap-top    { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.prod-scrap-status { font-size: 0.73rem; color: var(--text-dim); flex: 1; min-width: 0; }
.prod-scrap-status.success { color: #10B981; }
.prod-scrap-status.error   { color: #f87171; }
.prod-scrap-status.loading { color: var(--purple-light); }
.prod-scrap-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 5px 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.prod-scrap-btn:hover    { border-color: var(--purple); color: var(--purple-light); }
.prod-scrap-btn:disabled { opacity: 0.5; cursor: wait; }

/* Scrap info "i" button */
.prod-scrap-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.prod-scrap-info-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hi);
  color: var(--text-muted);
}
.prod-scrap-tooltip {
  position: fixed;
  width: 280px;
  padding: 10px 12px;
  background: var(--surface3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}
.prod-scrap-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.prod-scrap-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.prod-scrap-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.prod-scrap-copy-btn:hover { color: var(--text); border-color: var(--text-dim); }
.prod-scrap-copy-btn.hidden { display: none; }
.prod-scrap-output-wrap        { display: flex; flex-direction: column; }
.prod-scrap-output-wrap.hidden { display: none; }
.prod-scrap-textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  padding: 10px 13px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.6;
  min-height: 180px;
  max-height: 420px;
  outline: none;
}
.prod-scrap-textarea:focus { border-color: var(--purple); }

/* ── Product Picker Modal ───────────────────────────────── */
.prod-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}
.prod-picker-backdrop.hidden { display: none; }

.prod-picker-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.prod-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}
.prod-picker-header-left { display: flex; align-items: center; gap: 10px; }
.prod-picker-title  { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 0; }
.prod-picker-subtitle { font-size: 0.71rem; color: var(--text-dim); display: block; margin-top: 1px; }

.prod-picker-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 14px 0;
  padding: 9px 11px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px;
  font-size: 0.74rem;
  color: #fbbf24;
  line-height: 1.45;
  flex-shrink: 0;
}

.prod-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 8px;
  flex-shrink: 0;
}
.prod-picker-search {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 6px 10px;
  outline: none;
}
.prod-picker-search:focus { border-color: var(--purple); }
.prod-picker-sel-btn {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.prod-picker-sel-btn:hover { color: var(--text); border-color: var(--purple); }

.prod-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.prod-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
  user-select: none;
}
.prod-picker-item:hover { background: var(--surface2); }
.prod-picker-item.selected {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.2);
}

/* Hide native checkbox, use custom indicator */
.prod-picker-checkbox { display: none; }
.prod-picker-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.prod-picker-item.selected .prod-picker-check-box {
  background: var(--purple);
  border-color: var(--purple);
}
.prod-picker-check-box svg { display: none; }
.prod-picker-item.selected .prod-picker-check-box svg { display: block; }

.prod-picker-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.prod-picker-thumb-empty {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--text-dim);
}

.prod-picker-info { flex: 1; min-width: 0; }
.prod-picker-name {
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-picker-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-picker-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Right-side column: badge + price stacked */
.prod-picker-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

/* "✓ no perfil" badge */
.prod-picker-profiled-badge {
  font-size: 0.64rem;
  font-weight: 700;
  color: #10B981;
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 99px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* Section divider labels in picker list */
.prod-picker-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 10px 14px 4px;
}
.prod-picker-section-label--redo {
  color: rgba(250,204,21,0.8);
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.prod-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}
.prod-picker-count {
  font-size: 0.77rem;
  color: var(--text-dim);
}
.prod-picker-count strong { color: var(--purple-light); }

/* ── Context Profile Modal ──────────────────────────────── */
.prod-ctx-trigger-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}
.prod-ctx-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.prod-ctx-backdrop.hidden { display: none; }
.prod-ctx-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
}
.prod-ctx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}
.prod-ctx-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prod-ctx-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.prod-ctx-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
  margin-top: 1px;
}
.prod-ctx-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.prod-ctx-section { display: flex; flex-direction: column; gap: 6px; }
.prod-ctx-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prod-ctx-prompt-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.81rem;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.6;
  min-height: 280px;
  outline: none;
}
.prod-ctx-prompt-textarea:focus { border-color: var(--purple); }
.prod-ctx-output-section        { display: flex; flex-direction: column; gap: 6px; }
.prod-ctx-output-section.hidden { display: none; }
.prod-ctx-output-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prod-ctx-output-textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.73rem;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.55;
  min-height: 260px;
  outline: none;
}
.prod-ctx-output-textarea:focus { border-color: var(--purple); }
.prod-ctx-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
  gap: 12px;
}
.prod-ctx-status {
  font-size: 0.76rem;
  color: var(--text-dim);
  flex: 1;
}
.prod-ctx-status.error   { color: #f87171; }
.prod-ctx-status.success { color: #10B981; }
.prod-ctx-status.loading { color: var(--purple-light); }

/* Model selector row inside modal */
.prod-ctx-config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.prod-ctx-config-row .prod-ctx-label { white-space: nowrap; margin-bottom: 0; }
.prod-ctx-model-sel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  flex: 1;
}
.prod-ctx-model-sel:focus { border-color: var(--purple); }

/* ── Context Profile Card (right sidebar) ───────────────── */
.prod-ctx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid rgba(59,130,246,0.5);
  border-radius: 10px;
  overflow: hidden;
}
.prod-ctx-card.hidden { display: none; }

.prod-ctx-card-header {
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod-ctx-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.prod-ctx-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.prod-ctx-card-var {
  font-size: 0.67rem;
  font-family: 'Courier New', monospace;
  color: var(--purple-light);
  background: var(--purple-dim);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
}
.prod-ctx-card-meta {
  font-size: 0.67rem;
  color: var(--text-dim);
  padding: 0 14px 4px;
}
.prod-ctx-card-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 10px;
}
.prod-ctx-card-toggle-btn {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.prod-ctx-card-toggle-btn:hover { color: var(--text); border-color: var(--purple); }
.prod-ctx-card-body {
  border-top: 1px solid var(--border);
  padding: 0;
}
.prod-ctx-card-body.hidden { display: none; }
.prod-ctx-card-textarea {
  width: 100%;
  min-height: 160px;
  max-height: 420px;
  background: rgba(0,0,0,0.2);
  border: none;
  border-radius: 0;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.71rem;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

/* Sidebar placeholder when no profile exists */
.prod-side-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}
.prod-side-placeholder.hidden { display: none; }
.prod-side-placeholder p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  opacity: 0.7;
}
.prod-side-placeholder span {
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ═══ ClickUp Import ═══ */
.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  font-family: inherit;
  font-weight: 500;
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--surface2);
}

.modal-lg {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
}

.clickup-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.clickup-loading.hidden { display: none; }
.clickup-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.clickup-docs-list { display: block; }
.clickup-docs-list.hidden { display: none; }

.clickup-search {
  padding: 12px 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.clickup-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.12s;
}
.clickup-search input:focus {
  border-color: var(--purple);
}

.clickup-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clickup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  transition: all 0.12s;
}
.clickup-item:hover {
  background: var(--surface2);
  border-color: var(--purple-dim);
}
.clickup-item.selected {
  background: rgba(59,130,246,0.1);
  border-color: var(--purple);
}

.clickup-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.clickup-item.selected .clickup-checkbox {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.clickup-info {
  flex: 1;
  min-width: 0;
}
.clickup-title {
  font-weight: 500;
  color: var(--text);
  font-size: 0.88rem;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clickup-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0;
}

.clickup-empty { display: flex; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); }
.clickup-empty.hidden { display: none; }

.clickup-error { display: block; padding: 20px; background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm); color: var(--red); }
.clickup-error.hidden { display: none; }
.clickup-error p { margin: 0; }

#clickupImportBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════ */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.auth-screen::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-screen::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -15%;
  width: 50%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.auth-screen.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 36px;
}
.auth-brand-logo { height: 44px; width: auto; }
.auth-brand {
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.03em;
}
.auth-brand strong { color: var(--purple); font-weight: 800; }

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 24px 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.auth-form .form-group { margin-bottom: 18px; }
.auth-form .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.auth-form .form-group input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(30,41,59,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.auth-form .form-group input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 8px;
  cursor: pointer;
  justify-content: center;
  height: auto;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-normal);
}
.auth-submit:hover { transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0) scale(0.98); }
.auth-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.auth-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.auth-error.hidden { display: none; }

.auth-switch {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 20px;
}
.auth-switch a {
  color: var(--purple-light);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration-fast);
}
.auth-switch a:hover { color: var(--purple); text-decoration: underline; }

/* Logout button in sidebar */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-logout-btn:hover {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: var(--red);
}

/* Sync progress indicator */
.sync-progress {
  display: none;
  padding: 12px 16px;
  margin: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.sync-progress.active { display: block; }
.sync-progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.sync-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}
