* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, Arial, sans-serif;
  background: #f4f6fa;
  color: #0f172a;
}
header {
  padding: 28px 32px;
  background: #13716B;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.header-text {
  text-align: center;
}

.header-logo {
  position: absolute;
  left: 32px;
  height: 60px;
  width: auto;
}

header h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
}

header p {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}

@media (max-width: 900px) {
  .Content_Header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;  
  }

  .header-logo {
    position: static;
    margin-bottom: 16px;
    height: 50px;
    width: auto;
    max-width: 100%;
  }

  header h1 {
    font-size: 20px;
  }

  header p {
    font-size: 13px;
  }
}

.container {
  padding: 32px;
  max-width: 1600px;
  margin: auto;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.kpi {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease;
}
.kpi:hover {
  transform: translateY(-2px);
}
.kpi h3 {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi .value {
  margin-top: 12px;
  font-size: 32px;
  font-weight: 700;
  color: #13716B;
}

/* Cards (Charts, Tables, Maps) */
.charts, .tables, .maps {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}
.charts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tables { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.maps { grid-template-columns: 1fr 1fr; }

@media(max-width: 1100px){
  .maps { grid-template-columns: 1fr; }
}

.card, .map-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.card h3, .map-card h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

/* Tables */
.table-wrap {
  max-height: 360px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

@media (max-width: 500px) {

  .tables{
    display: flex;
    flex-direction: column;
  }

  table{
    width: 90vw;
  }
}

thead {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
th, td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
th { font-weight: 600; color: #475569; }
td.num { text-align: right; font-weight: 500; }
tbody tr:hover { background: #f1f5f9; }

/* Maps */
.map {
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.legend {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.legend i {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* Utilities */
.loader, .error {
  padding: 60px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}
.loader { color: #64748b; }
.error { color: #ef4444; }



footer {
  background: #13716B; /* Mesma cor do cabeçalho */
  color: #fff;
  padding: 24px 32px;
  margin-top: 40px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.footer-content {
  max-width: 1600px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Permite que os links quebrem de linha em ecrãs pequenos */
  gap: 16px;
}

.footer-content p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

@media(max-width: 768px){
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

.chart-controls {
  text-align: center;
  margin-top: -16px;
  margin-bottom: 32px;
}

.btn {
  background: #13716B;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(19, 113, 107, 0.2);
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: #0b4d49;
  transform: translateY(-2px);
}