/* Settle Gov — Previsao de Licitacoes — Shared Styles */

:root {
  --navy: #1B2A4A;
  --navy-800: #243558;
  --navy-700: #2D4068;
  --teal: #6ECEB2;
  --teal-dark: #4BA88E;
  --teal-light: #E8F8F3;
  --bg: #F8F9FC;
  --danger: #EF4444;
  --warning-high: #F97316;
  --warning-mid: #F59E0B;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #334155;
  margin: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Sidebar */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--navy);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.2s;
}

.sidebar-logo {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--navy-700);
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  padding: 16px 24px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: #94A3B8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--navy-800);
  color: #E2E8F0;
}

.nav-item.active {
  background: var(--navy-800);
  color: #FFFFFF;
  border-left-color: var(--teal);
}

.nav-item.active i { color: var(--teal); }

.nav-item i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--navy-700);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-name { color: #E2E8F0; font-size: 13px; font-weight: 500; }
.sidebar-user-role { color: #64748B; font-size: 11px; }

/* Main content */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
}

.header {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.header-subtitle {
  font-size: 13px;
  color: #64748B;
  margin-top: 2px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 8px 16px;
  width: 320px;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #334155;
  width: 100%;
  font-family: inherit;
}

.header-search input::placeholder { color: #94A3B8; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-notif {
  position: relative;
  cursor: pointer;
  color: #64748B;
}

.header-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-content {
  padding: 24px 32px;
}

/* KPI Cards */
.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #F1F5F9;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748B;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.kpi-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-change.up { color: #10B981; }
.kpi-change.down { color: var(--danger); }

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #F1F5F9;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.card-body { padding: 20px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}

.badge-urgente { background: #FEF2F2; color: #DC2626; }
.badge-alta { background: #FFF7ED; color: #EA580C; }
.badge-media { background: #FFFBEB; color: #D97706; }
.badge-planejavel { background: var(--teal-light); color: var(--teal-dark); }
.badge-teal { background: var(--teal-light); color: var(--teal-dark); }
.badge-blue { background: #EFF6FF; color: #2563EB; }

/* Score bar */
.score-bar {
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
  width: 80px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--teal);
}

/* Timeline */
.timeline-h {
  display: flex;
  align-items: center;
  position: relative;
  padding: 24px 0;
}

.timeline-h-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: #E5E7EB;
  transform: translateY(-50%);
}

.timeline-h-point {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timeline-h-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--teal);
  background: white;
}

.timeline-h-dot.filled { background: var(--teal); }
.timeline-h-dot.danger { border-color: var(--danger); }

.timeline-h-label {
  font-size: 11px;
  color: #64748B;
  white-space: nowrap;
}

.timeline-h-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

/* Dossie timeline */
.dossie-timeline {
  position: relative;
  padding: 20px 8% 8px;
}

.dossie-timeline-track,
.dossie-timeline-fill {
  position: absolute;
  top: 85px;
  height: 6px;
  border-radius: 999px;
}

.dossie-timeline-track {
  left: 10%;
  right: 10%;
  background: #E2E8F0;
}

.dossie-timeline-fill {
  left: 10%;
  width: 35%;
  background: var(--teal);
}

.dossie-timeline-points {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.dossie-timeline-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.dossie-timeline-copy {
  min-height: 40px;
  margin-bottom: 14px;
  text-align: center;
}

.dossie-timeline-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.dossie-timeline-date {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  color: #64748B;
}

.dossie-timeline-meta {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.dossie-timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border-width: 4px;
  border-style: solid;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .dossie-timeline {
    padding-left: 0;
    padding-right: 0;
  }

  .dossie-timeline-track,
  .dossie-timeline-fill {
    left: 24px;
    right: 24px;
  }

  .dossie-timeline-fill {
    width: calc(35% - 16px);
  }

  .dossie-timeline-points {
    gap: 12px;
  }
}

/* Vertical timeline */
.timeline-v {
  position: relative;
  padding-left: 24px;
}

.timeline-v::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #E5E7EB;
}

.timeline-v-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-v-dot {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--teal);
}

.timeline-v-dot.filled { background: var(--teal); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748B;
  padding: 10px 12px;
  border-bottom: 1px solid #E5E7EB;
}

.data-table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #F8FAFC; }

/* Traffic light dot */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-urgente { background: var(--danger); }
.dot-alta { background: var(--warning-high); }
.dot-media { background: var(--warning-mid); }
.dot-planejavel { background: var(--teal); }

/* Pulse animation for urgent dots */
.dot-urgente {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Brazil map */
.brazil-map svg {
  width: 100%;
  height: auto;
}

.brazil-map path {
  stroke: white;
  stroke-width: 1;
  cursor: pointer;
  transition: opacity 0.15s;
}

.brazil-map path:hover {
  opacity: 0.8;
  stroke-width: 2;
}

.map-heat-0 { fill: #F0FDF9; }
.map-heat-1 { fill: #B2F0DD; }
.map-heat-2 { fill: #6ECEB2; }
.map-heat-3 { fill: #3BA68D; }
.map-heat-4 { fill: #1B7A68; }

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.checklist-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-check.done {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

/* Filter chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #E5E7EB;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--teal); }
.filter-chip.active { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }

/* Toggle switch */
.toggle {
  width: 40px;
  height: 22px;
  background: #CBD5E1;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.on { background: var(--teal); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle.on::after { transform: translateX(18px); }

/* Utility */
.text-navy { color: var(--navy); }
.text-teal { color: var(--teal); }
.bg-teal-light { background: var(--teal-light); }
.border-teal { border-color: var(--teal); }
