/* ================================================================
   Maestro OS — app.css v6.0.0
   Compatibilidade e extensões do design system inline (index.html)
   Não redefine variáveis CSS – apenas complementa estilos usados
   pelo app.js e pelos componentes gerados dinamicamente.
   ================================================================ */

/* ── TOAST (gerado por app.js) ──────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
}
.toast-notification {
  pointer-events: auto;
  background: var(--panel2, #1b2740);
  border: 1px solid var(--line, #243047);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--txt, #e7edf6);
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: toast-in .24s ease;
  max-width: 360px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast-notification.success { border-color: rgba(34,197,94,.4); }
.toast-notification.error   { border-color: rgba(239,68,68,.4); }
.toast-notification.info    { border-color: rgba(14,165,183,.4); }
.toast-notification.warning { border-color: rgba(245,158,11,.4); }

/* ── HEALTH BOARD (gerado por app.js loadMacroDashboard) ────── */
.health-score-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--line, #243047);
  margin-top: 4px;
  overflow: hidden;
  min-width: 80px;
}
.health-score-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand, #0ea5b7), var(--accent, #22d3ee));
  transition: width .4s;
}
.score-label {
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
}
.score-label.red    { color: #ef4444; }
.score-label.amber  { color: #f59e0b; }
.score-label.green  { color: #22c55e; }
.score-label.brand  { color: var(--brand, #0ea5b7); }
.gap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gap-tag {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(239,68,68,.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.22);
  font-weight: 700;
}
.funnel-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.funnel-bar-wrap {
  flex: 1;
  height: 18px;
  background: var(--line, #243047);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand, #0ea5b7), var(--brand2, #1473b8));
  transition: width .4s;
}
.funnel-label { font-size: 11px; color: var(--muted, #93a2bd); min-width: 100px; }
.funnel-count { font-size: 11px; font-weight: 700; color: var(--txt, #e7edf6); min-width: 24px; text-align: right; }

/* ── POOL STATUS CARDS (app.js renderPoolDashboard) ─────────── */
.pool-key-card {
  background: var(--bg2, #111826);
  border: 1px solid var(--line, #243047);
  border-radius: 10px;
  padding: 12px 14px;
}
.pool-key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pool-key-id {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: monospace;
  color: var(--accent, #22d3ee);
}
.pool-key-prov {
  font-size: 10.5px;
  color: var(--muted, #93a2bd);
  background: var(--panel, #161f2e);
  padding: 2px 8px;
  border-radius: 5px;
}

/* ── AI LOG TABLE ROW STYLES ────────────────────────────────── */
#ai-logs-tbody tr { border-bottom: 1px solid var(--line, #243047); }
#ai-logs-tbody tr:hover { background: rgba(255,255,255,.02); }
#ai-logs-tbody td { padding: 6px 10px; }
.log-prov-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.log-prov-gemini   { background: rgba(59,130,246,.15); color: #60a5fa; }
.log-prov-openai   { background: rgba(16,185,129,.15); color: #34d399; }
.log-prov-anthropic{ background: rgba(139,92,246,.15); color: #a78bfa; }
.log-prov-groq     { background: rgba(245,158,11,.15); color: #fbbf24; }
.log-prov-perplexity{background: rgba(99,102,241,.15); color: #818cf8; }

/* ── KANBAN TASK CARDS (generated by app.js renderTasks) ─────── */
.task-card {
  background: var(--panel, #161f2e);
  border: 1px solid var(--line, #243047);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: grab;
  transition: box-shadow .12s, transform .12s;
  position: relative;
}
.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.task-card.dragging {
  opacity: .5;
  cursor: grabbing;
}
.task-card-title {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  cursor: pointer;
  transition: color .1s;
}
.task-card-title:hover { color: var(--accent, #22d3ee); }
.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted, #93a2bd);
  flex-wrap: wrap;
  gap: 4px;
}
.task-due-near { color: var(--amber, #f59e0b); }
.task-due-late { color: var(--red, #ef4444); }
.task-card-ai-origin {
  font-size: 9.5px;
  color: var(--muted2, #64748b);
  font-style: italic;
  margin-top: 3px;
  border-top: 1px solid var(--line, #243047);
  padding-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* CRM cards */
.crm-card {
  background: var(--panel, #161f2e);
  border: 1px solid var(--line, #243047);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: grab;
  transition: box-shadow .12s, transform .12s;
}
.crm-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.crm-card-title {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
  cursor: pointer;
}
.crm-card-title:hover { color: var(--accent, #22d3ee); }
.crm-card-meta { font-size: 10.5px; color: var(--muted, #93a2bd); }
.crm-fee {
  font-size: 12px;
  font-weight: 800;
  color: var(--green, #22c55e);
  margin-top: 4px;
}

/* ── ACTIVE PROCESS (Progress Modal) ─────────────────────────── */
.active-process-pulse-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── ROUTER GRID ────────────────────────────────────────────── */
.router-card {
  background: var(--panel, #161f2e);
  border: 1px solid var(--line, #243047);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11px;
}
.router-card-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted2, #64748b);
  margin-bottom: 5px;
  font-weight: 700;
}
.router-card-value { font-weight: 700; color: var(--accent, #22d3ee); }

/* ── NOTIFICATION ITEM TYPES ─────────────────────────────────── */
.notification-item .notif-icon { font-size: 16px; flex-shrink: 0; }
.notification-item .notif-body { flex: 1; min-width: 0; }
.notification-item .notif-title { font-weight: 700; font-size: 12px; }
.notification-item .notif-desc  { font-size: 11px; color: var(--muted, #93a2bd); margin-top: 1px; }
.notification-item .notif-time  { font-size: 10px; color: var(--muted2, #64748b); margin-top: 2px; }
.notification-item { display: flex; align-items: flex-start; gap: 9px; }

/* ── THEME TOGGLE (handled by theme-manager.js) ──────────────── */
[data-theme="light"] #theme-toggle .icon-dark  { display: none; }
[data-theme="dark"]  #theme-toggle .icon-light { display: none; }
[data-theme="light"] #theme-toggle .icon-light { display: inline; }
[data-theme="dark"]  #theme-toggle .icon-dark  { display: inline; }

/* ── SETTINGS FORM LABELS WITH icons ────────────────────────── */
.settings-tabs .tab-btn i[data-lucide] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── TRANSITION POLISH ───────────────────────────────────────── */
.main-tab-content {
  animation: fade-in .18s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MACRO DONUT SEGMENTS ────────────────────────────────────── */
.donut-segment { transition: stroke-dashoffset .4s ease; }
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted, #93a2bd);
}
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── SCROLLBAR inside views ──────────────────────────────────── */
.view::-webkit-scrollbar         { width: 5px; }
.view::-webkit-scrollbar-thumb   { background: var(--line2, #2e3c57); border-radius: 4px; }
.view::-webkit-scrollbar-track   { background: transparent; }
.k-col-body::-webkit-scrollbar   { width: 4px; }
.k-col-body::-webkit-scrollbar-thumb { background: var(--line2, #2e3c57); border-radius: 4px; }
.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--line2, #2e3c57); border-radius: 4px; }

/* ── ENSURE SETTINGS TABS PANE ISOLATION ────────────────────── */
#tab-agency-settings .tab-pane:not(.active) { display: none !important; }
#tab-agency-settings .tab-pane.active { display: block !important; }

/* ── TWO-COLUMN HELPER ───────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media(max-width: 640px) { .two-col { grid-template-columns: 1fr; } }



/* ── ACTIVE PROCESS PROGRESS & PILL ───────────────────────────── */
.active-process-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 165, 183, 0.1);
  border: 1px solid rgba(14, 165, 183, 0.28);
  border-radius: 9px;
  padding: 5px 10px;
  cursor: pointer;
  transition: .14s;
  max-width: 180px;
}
.active-process-pill:hover { background: rgba(14, 165, 183, 0.18); }
.active-process-pulse-container { flex-shrink: 0; }
.active-process-pulse-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: proc-pulse 1.2s ease-in-out infinite;
}
@keyframes proc-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.75)} }
.active-process-pill-content { min-width: 0; flex: 1; }
.active-process-header-row { display: flex; justify-content: space-between; align-items: center; }
.active-process-pill-title { font-size: 10px; font-weight: 700; color: var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-process-pill-timer { font-size: 9.5px; color: var(--muted); font-family: monospace; flex-shrink: 0; margin-left: 4px; }
.active-process-pill-desc { font-size: 9.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-process-mini-bar-wrap { height: 3px; background: var(--line); border-radius: 2px; margin-top: 2px; overflow: hidden; }
.active-process-mini-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 2px; transition: width .3s; width: 0%; }

.progress-bar-wrap { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 3px; transition: width .4s; width: 0%; }
