/* --- Footer --- */
.footer {
  max-width: 1200px;
  margin: 48px auto 0;
  padding: 24px 24px 32px;
}
.footer-env {
  margin-bottom: 16px;
}
.footer-env .env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.footer-logo {
  margin-bottom: 8px;
}
.footer-logo img { width: 105px; height: 32px; }
.footer-copy { color: #CCCCCC; font-size: 14px; font-weight: 400; line-height: 20px; text-decoration: none; }
.footer-right {
  text-align: right;
}
.footer-socials {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  align-items: center;
}
.footer-socials a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  margin-left: 24px;
  padding: 0;
}
.footer-socials a:first-child { margin-left: 0; }
.footer-socials a:hover { color: #FFFFFF; }
.footer-socials .icon-gh svg { width: 28px; height: 32px; fill: currentColor; }
.footer-socials .icon-x svg { width: 22px; height: 32px; fill: currentColor; }
.footer-socials .icon-dc svg { width: 28px; height: 32px; fill: currentColor; }
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  color: #CCCCCC;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  transition: color 0.2s;
}
.footer-links a:hover { color: #FFFFFF; }

/* --- Env badge --- */
.env-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border: 1px solid rgba(0, 155, 255, 0.7);
  border-radius: 16px;
  padding: 0;
  font-size: 13px;
  color: #009BFF;
  cursor: default;
  position: relative;
}
.env-badge .env-label {
  padding: 0 7px;
}
.env-badge .env-info {
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1, 'GRAD' 0, 'opsz' 20, 'wght' 400;
  font-size: 16px;
  color: rgba(0, 155, 255, 0.7);
  width: 16px;
  height: 16px;
  line-height: 16px;
  margin: 0 3px 0 -4px;
  cursor: pointer;
}
.env-badge .env-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: rgba(27, 29, 30, 0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #CCCCCC;
  white-space: nowrap;
  z-index: 10;
}
.env-badge:hover .env-tooltip {
  display: block;
}

/* --- Mobile / small viewports --- */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .navbar {
    padding: 12px 12px 0 12px;
    height: auto;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .navbar .logo { margin-right: 12px; }

  .nav-tabs {
    order: 3;
    width: 100%;
    height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-tab {
    min-width: 0;
    padding: 10px 12px;
    font-size: 15px;
  }

  .last-sync {
    margin-left: auto;
    margin-right: 0;
    font-size: 12px;
  }

  .page-container {
    margin-top: 24px;
    padding: 0 16px;
  }
  .page-title { font-size: 32px; line-height: 1.15; }
  .page-subtitle { font-size: 14px; margin-bottom: 20px; }

  .kpi-row { gap: 12px; margin-bottom: 20px; }
  .kpi-card { min-width: calc(50% - 6px); padding: 14px 10px; }
  #dusdKpis .kpi-card, #revenueKpis .kpi-card { min-width: calc(50% - 6px); }
  .kpi-value { font-size: 24px; }
  .kpi-label { font-size: 12px; }

  .chart-row { gap: 12px; margin-bottom: 20px; }
  .chart-card,
  .chart-card.three-quarter,
  .chart-card.quarter {
    min-width: 0;
    flex-basis: 100%;
    padding: 12px;
    overflow-x: auto;
  }
  .psm-status-col { min-width: 0; flex-basis: 100%; }

  .chart-wrapper { height: 260px; }

  /* Tables: let them scroll horizontally inside their card, not the page. */
  .data-table { font-size: 12px; white-space: nowrap; }
  .data-table th, .data-table td { padding: 8px 10px; }

  .filter-bar { font-size: 12px; gap: 8px; }

  /* Footer stacks on mobile */
  .footer { padding: 20px 16px 24px; margin-top: 32px; }
  .footer-main { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-right { text-align: left; width: 100%; }
  .footer-socials { justify-content: flex-start; }
  .footer-socials a { margin-left: 0; margin-right: 20px; }
  .footer-socials a:first-child { margin-left: 0; }
  .footer-links { flex-wrap: wrap; gap: 16px; }
}
