/* Pigma Design System - Rastreio Influencers */

:root {
  --pigma-500: #FF5A26;
  --pigma-600: #FF410F;
  --neutral-50: #FAFAFA;
  --neutral-100: #F1F1F1;
  --neutral-200: #E5E5E5;
  --neutral-400: #A3A3A3;
  --neutral-500: #7A7A7A;
  --neutral-600: #545454;
  --neutral-700: #424546;
  --neutral-800: #383838;
  --neutral-900: #1F1F1F;
  --filter-color: #FF5A26;
}

/* ── Sidebar ── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  margin: 0.125rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #A3A3A3;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.05);
}
.sidebar-link.active {
  color: #FF5A26;
  background-color: rgba(255, 90, 38, 0.08);
  border-left-color: #FF5A26;
  font-weight: 600;
}

/* ── Dashboard Cards ── */
.dash-card {
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid #E5E5E5;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── KPI Hero Cards ── */
.kpi-hero {
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid #E5E5E5;
  border-left: 5px solid #E5E5E5;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.kpi-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.kpi-hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7A7A7A;
  margin-bottom: 0.375rem;
}
.kpi-hero-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #383838;
  line-height: 1.1;
}
.kpi-hero-pct {
  font-size: 0.75rem;
  color: #A3A3A3;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ── Dashboard Grid Layout ── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.25rem;
}
@media (max-width: 1280px) {
  .dash-main-grid { grid-template-columns: 1fr 360px; }
}
@media (max-width: 1024px) {
  .dash-main-grid { grid-template-columns: 1fr; }
}

.dash-map-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-self: start;   /* don't stretch to the taller side panel — kills the empty gap */
}

#map-container {
  flex: 0 0 auto;
  height: 560px;
  min-height: 560px;
  position: relative;
  overflow: hidden;
}

#map-svg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#map-svg-wrap svg {
  width: 100%;
  height: 100%;
}

/* ── Tooltip ── */
.dash-tooltip {
  position: absolute;
  background: #1F1F1F;
  color: #FFFFFF;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 60;
  white-space: nowrap;
}

/* ── Geographic Map (GeoJSON) ── */
.geo-svg {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes geoFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.geo-fade { animation: geoFade 320ms ease; }

.geo-state {
  stroke: #FFFFFF;
  stroke-width: 0.8;
  transition: filter 160ms ease, opacity 200ms ease;
}
.geo-state.clickable, .geo-mun.clickable { cursor: pointer; }
.geo-state:hover {
  filter: brightness(1.06) drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}

.geo-mun {
  stroke: #FFFFFF;
  stroke-width: 0.35;
  transition: filter 140ms ease;
}
.geo-mun:hover {
  stroke: #383838;
  stroke-width: 0.9;
  filter: brightness(0.95);
}
.geo-mun.selected {
  stroke: #1F1F1F;
  stroke-width: 1.4;
}

.geo-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  fill: #FFFFFF;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 2.5px;
}

.geo-city-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  fill: #1F1F1F;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.9);
  stroke-width: 2.5px;
}

/* ── Breadcrumb ── */
.breadcrumb-item {
  color: #7A7A7A;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 150ms ease;
  cursor: pointer;
  border: none;
  background: none;
}
.breadcrumb-item:hover {
  color: #383838;
  background: #F1F1F1;
}
.breadcrumb-item.active {
  color: #FF5A26;
  font-weight: 700;
  background: #FFF1EC;
}
.breadcrumb-sep {
  color: #D1D1D1;
  font-size: 0.875rem;
}

/* ── Status Bars ── */
.status-bar-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
}
.status-bar-row .bar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #545454;
  width: 7.5rem;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-bar-row .bar-bg {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #F1F1F1;
  overflow: hidden;
}
.status-bar-row .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.status-bar-row .bar-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #383838;
  width: 4rem;
  text-align: right;
  flex-shrink: 0;
}

/* ── Drill List (floating overlay) ── */
#drill-list {
  position: absolute;
  left: 1rem;
  top: 5.5rem;
  bottom: 1rem;
  width: 280px;
  max-height: 420px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  border: 1px solid #E5E5E5;
  padding: 1rem;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.drill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid transparent;
}
.drill-item:hover {
  background: #FFF1EC;
  border-color: #FFE0D4;
}
.drill-item-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #383838;
}
.drill-item .drill-bar {
  width: 60px;
  height: 5px;
  border-radius: 3px;
  background: #F1F1F1;
  overflow: hidden;
}
.drill-item .drill-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #FF5A26, #FF8254);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.drill-item-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #545454;
}

/* ── Panel List ── */
.panel-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 120ms ease;
  font-size: 0.9375rem;
  border: 1px solid transparent;
}
.panel-list-item:hover {
  background: #FFF1EC;
  border-color: #FFE0D4;
}
.panel-list-item .item-label {
  font-weight: 500;
  color: #424546;
}
.panel-list-item .item-count {
  font-weight: 800;
  font-size: 0.9375rem;
  color: #FF5A26;
}

/* ── Status & Region Filter Tabs ── */
.status-tab, .regiao-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #7A7A7A;
  background: #F1F1F1;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.status-tab:hover, .regiao-tab:hover {
  color: #383838;
  background: #E5E5E5;
}
.status-tab.active {
  color: var(--filter-color);
  background: color-mix(in srgb, var(--filter-color) 10%, white);
  border-color: var(--filter-color);
}
.regiao-tab.active {
  color: var(--regiao-color, #FF5A26);
  background: color-mix(in srgb, var(--regiao-color, #FF5A26) 10%, white);
  border-color: var(--regiao-color, #FF5A26);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeSlideUp 350ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pinPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pin-pop {
  animation: pinPop 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Global Utilities ── */
* { transition-property: color, background-color, border-color, opacity, box-shadow, transform; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D1D1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #A3A3A3; }

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 90, 38, 0.18);
}

/* ── Legacy KPI Cards (entregas page) ── */
.kpi-card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #E5E5E5;
  border-left: 4px solid #E5E5E5;
  padding: 1rem 1.25rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.kpi-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7A7A7A;
  margin-bottom: 0.25rem;
}
.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #383838;
  line-height: 1.2;
}
.kpi-percent {
  font-size: 0.6875rem;
  color: #A3A3A3;
  margin-top: 0.125rem;
}
