/**
 * DASHBOARD.CSS — Estilos específicos da página principal
 *
 * Estilos gerais do layout (sidebar, topbar, cards base) estão em global.css.
 * Este arquivo contém apenas estilos exclusivos do dashboard.
 *
 * ONDE ALTERAR:
 *   - Aparência dos cards de KPI → .stat-card (herdado de global.css, sobrescreva aqui)
 *   - Layout dos gráficos        → .chart-container
 *   - Feed de atividades         → já em global.css (.activity-*)
 *   - Lista de tarefas           → já em global.css (.todo-*)
 */

/* ─── KPI Cards ──────────────────────────────── */
.db-kpi-card {
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.db-kpi-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.db-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.db-kpi-blue   { background: #eff6ff; color: #1a73e8; }
.db-kpi-green  { background: #ecfdf5; color: #059669; }
.db-kpi-orange { background: #fff7ed; color: #ea580c; }
.db-kpi-amber  { background: #fffbeb; color: #d97706; }

.db-kpi-val {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.db-kpi-val.verde    { color: #16a34a; }
.db-kpi-val.amarelo  { color: #d97706; }
.db-kpi-val.vermelho { color: #dc2626; }

.db-kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Gráfico de evolução — legenda ─────────── */
.db-evo-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: center;
}

.db-evo-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.db-evo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Responsivo KPIs */
@media (max-width: 575px) {
  .db-kpi-val { font-size: 26px; }
}

/* ─── Nosso Sonho — layout principal ────────── */
.ns-container {
  display: flex;
  flex-direction: row;
  gap: 16px;
  padding: 4px 0 2px;
  align-items: stretch;
}

/* Coluna esquerda: Leão PEX + Pirâmide */
.ns-pyramid-col {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ns-pyramid {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.ns-level {
  position: relative;
}

.ns-level::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/*
 * Geometria: 3 × 80px = 240px total. Ponta real em 50%.
 * y=80  → 33%/67%   y=160 → 17%/83%   y=240 → 0%/100%
 */
.ns-blue   { height: 80px; }
.ns-red    { height: 80px; }
.ns-yellow { height: 80px; }

.ns-blue::before {
  background: #2563eb;
  clip-path: polygon(50% 0%, 50% 0%, 67% 100%, 33% 100%);
}
.ns-red::before {
  background: #dc2626;
  clip-path: polygon(33% 0%, 67% 0%, 83% 100%, 17% 100%);
}
.ns-yellow::before {
  background: #ca8a04;
  clip-path: polygon(17% 0%, 83% 0%, 100% 100%, 0% 100%);
}

/* Rótulos externos — abaixo de cada seção da pirâmide */
.ns-plabel {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 0 5px;
}
.ns-plabel-b { color: #2563eb; }
.ns-plabel-r { color: #dc2626; }
.ns-plabel-y { color: #854d0e; }

/* Espaçador que replica a altura do Leão PEX + gap, empurrando os cards para baixo */
.ns-info-spacer {
  flex-shrink: 0;
  height: 53px;
}

/* Coluna direita — cards alinhados com as seções da pirâmide */
.ns-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ns-detail-card {
  flex: 1;
  padding: 10px 14px;
}

.ns-info-col .ns-detail-card:first-child { border-radius: 10px 10px 0 0; }
.ns-info-col .ns-detail-card:last-child  { border-radius: 0 0 10px 10px; }
.ns-info-col .ns-detail-card:not(:first-child):not(:last-child) { border-radius: 0; }

.ns-dc-blue   { background: #eff6ff; border-left: 3px solid #2563eb; }
.ns-dc-red    { background: #fef2f2; border-left: 3px solid #dc2626; }
.ns-dc-yellow { background: #fefce8; border-left: 3px solid #ca8a04; }

.ns-dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.ns-dc-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.ns-dc-blue   .ns-dc-title { color: #1d4ed8; }
.ns-dc-red    .ns-dc-title { color: #b91c1c; }
.ns-dc-yellow .ns-dc-title { color: #854d0e; }

.ns-dc-headpct {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.ns-dc-blue   .ns-dc-headpct { color: #2563eb; }
.ns-dc-red    .ns-dc-headpct { color: #dc2626; }
.ns-dc-yellow .ns-dc-headpct { color: #ca8a04; }

.ns-dc-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ns-dc-item {
  font-size: 11px;
  color: #475569;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.ns-dc-pct {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  min-width: 28px;
  display: inline-block;
  flex-shrink: 0;
}

.ns-dc-val {
  font-weight: 600;
  color: #334155;
}

/* Leão PEX — compacto horizontal (topo da coluna esquerda) */
.ns-leao-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
}

.ns-lc-icon {
  font-size: 20px;
  color: #fbbf24;
  flex-shrink: 0;
}

.ns-lc-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fbbf24;
  margin-bottom: 3px;
}

.ns-lc-vals {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ns-lc-bonus {
  font-size: 16px;
  font-weight: 700;
}

.ns-lc-pontos {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

/* ─── Modal de edição ───────────────────────── */
.ns-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.ns-modal-footer {
  padding: 14px 24px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.ns-section-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.ns-head-blue   { background: #eff6ff; color: #1d4ed8; }
.ns-head-red    { background: #fef2f2; color: #b91c1c; }
.ns-head-yellow { background: #fefce8; color: #854d0e; }
.ns-head-leao   { background: #fff7ed; color: #92400e; }

.ns-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.ns-field-input {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s;
  background: #fff;
}

.ns-field-input:focus { border-color: var(--blue-primary); }

.btn-ns-cancel {
  padding: 9px 18px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s;
}

.btn-ns-cancel:hover { background: #f8fafc; }

.btn-ns-save {
  padding: 9px 20px;
  background: var(--blue-primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}

.btn-ns-save:hover { background: var(--blue-dark); }

/* ─── Linhas de indicadores (modal dinâmico) ── */
.ns-ind-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.ns-ind-fields {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  gap: 8px;
  flex: 1;
}

.btn-ns-del-ind {
  background: none;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
  transition: background .15s;
}
.btn-ns-del-ind:hover { background: #fee2e2; }

.btn-ns-add-ind {
  background: none;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  padding: 7px 14px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
  transition: border-color .15s, color .15s;
}
.btn-ns-add-ind:hover { border-color: var(--blue-primary); color: var(--blue-primary); }

/* Toggle switch Leão PEX */
.ns-section-head { display: flex; align-items: center; }

.ns-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.ns-toggle input { opacity: 0; width: 0; height: 0; }
.ns-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 20px;
  transition: background .2s;
}
.ns-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.ns-toggle input:checked + .ns-toggle-slider { background: #22c55e; }
.ns-toggle input:checked + .ns-toggle-slider::before { transform: translateX(16px); }

/* Responsivo */
@media (max-width: 575px) {
  .ns-container    { flex-direction: column; gap: 16px; }
  .ns-pyramid-col  { width: 120px; margin: 0 auto; }
  .ns-blue         { height: 60px; }
  .ns-red          { height: 60px; }
  .ns-yellow       { height: 60px; }
  .ns-leao-compact { flex-wrap: wrap; }
  .ns-info-col .ns-detail-card:first-child,
  .ns-info-col .ns-detail-card:last-child,
  .ns-info-col .ns-detail-card:not(:first-child):not(:last-child) { border-radius: 10px; }
  .ns-info-col { gap: 8px; }
}

/* ─── Boletim Diário ──────────────────────────── */
.boletim-widget {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.boletim-hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}

.boletim-hdr:hover { background: #f8fafc; }

.boletim-hdr-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.bhi-manha { background: #fffbeb; color: #d97706; }
.bhi-tarde  { background: #fff7ed; color: #ea580c; }
.bhi-noite  { background: #f5f3ff; color: #7c3aed; }

.boletim-hdr-text { flex: 1; min-width: 0; }

.boletim-saudacao {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.boletim-data {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.boletim-chevron {
  font-size: 12px;
  color: #94a3b8;
  transition: transform .25s;
  flex-shrink: 0;
}

.boletim-widget.collapsed .boletim-chevron { transform: rotate(180deg); }

.boletim-body { border-top: 1px solid var(--card-border); }

/* Status do mês */
.boletim-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid #f1f5f9;
}

.boletim-status-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-right: 2px;
  white-space: nowrap;
}

.bol-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}

.bol-pill i { font-size: 11px; }

.bol-verde   { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.bol-amarelo { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.bol-vermelho{ background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.bol-neutro  { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }

/* Alertas */
.boletim-alertas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px 14px;
}

.bol-alerta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s;
}

.bol-alerta:hover { opacity: .85; }
.bol-alerta i { font-size: 12px; flex-shrink: 0; }

.bol-danger  { background: #fef2f2; color: #dc2626; }
.bol-warning { background: #fffbeb; color: #b45309; }
.bol-info    { background: #eff6ff; color: #1d4ed8; }
.bol-ok      { background: #f0fdf4; color: #15803d; }

@media (max-width: 575px) {
  .boletim-hdr { padding: 12px 14px; }
  .boletim-status { padding: 8px 14px; }
  .boletim-alertas { padding: 8px 14px 12px; }
}
