/* =========================
   Global Reset & Base
   ========================= */

:root {
  --content-max-width: 1400px;
  --content-padding: clamp(1rem, 3vw, 2rem);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #e6eae6;
  background-color: #0f1a14;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================
   Header / Navigation
   ========================= */

header {
  background-color: #13251c;
  color: #e6f2ea;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f3a2c;
}

header > * {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 1rem var(--content-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.7rem;
  font-weight: 700;
}

nav a {
  margin-left: 1.5rem;
  font-weight: 600;
  color: #cfe6da;
  transition: color 0.25s ease;
}

nav a:hover {
  color: #9fe0b8;
}

/* =========================
   Sections (layout contract)
   ========================= */

section {
  width: 100%;
  padding: var(--content-padding);
  display: flex;
  justify-content: center;
}

section > * {
  width: 100%;
  max-width: var(--content-max-width);
}

section h2 {
  color: #e6f2ea;
}

/* =========================
   Hero Section (FIXED)
   ========================= */

.hero {
  min-height: 70vh;
  background: linear-gradient(
    135deg,
    #305841 0%,
    #183528 50%,
    #1f4735 100%
  );
  color: #e9f4ee;
  text-align: center;

  display: flex;
  flex-direction: column;     /* ← vertical stacking */
  justify-content: center;
  align-items: center;

  flex-shrink: 0;             /* ← immune to dashboard */
}

#hero-section.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


.hero h2 {
  font-size: 2.6rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  max-width: 700px;
  margin-bottom: 2.2rem;
  color: #cfe6da;
}

.hero a,
.hero button {
  padding: 0.85rem 1.7rem;
  background-color: #2f6f4e;
  color: #e9f4ee;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.hero a:hover,
.hero button:hover {
  background-color: #3e8b63;
  transform: translateY(-2px);
}

/* =========================
   Features
   ========================= */

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.feature-card {
  background-color: #367e5e;
  color: #e9f4ee;
  border-radius: 14px;
  padding: 2rem;
  flex: 1 1 260px;
  border: 1px solid #2f6f4e;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* =========================
   Dashboard (FIXED)
   ========================= */

#dashboard-section {
  flex-direction: column;
  align-items: center;
}

#dashboard-section > * {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
  flex-shrink: 0;              /* ← stop page shrink */
}

.chart-container,
#table-container {
  flex: 1 1 48%;
  min-width: 300px;
  background-color: #769c63;
  padding: 20px;
  border-radius: 1rem;
  border: 1px solid #678a67;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);

  display: flex;
  flex-direction: column;

  max-height: none;            /* ← remove vh coupling */
}

.chart-container canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
}

/* Table */
#table-container {
  overflow-y: auto;
}

/* =========================
   Tables
   ========================= */

table {
  width: 100%;
  border-collapse: collapse;
}

table,
th,
td {
  border: 1px solid #ccc;
}

th,
td {
  padding: 8px;
  text-align: center;
}

th {
  background-color: #c8e6c9;
}

/* =========================
   Footer
   ========================= */

footer {
  background-color: #13251c;
  color: #cfe6da;
  text-align: center;
  padding: 2rem var(--content-padding);
  border-top: 1px solid #1f3a2c;
  margin-top: 4rem;
}

footer a {
  color: #9fe0b8;
}

footer a:hover {
  text-decoration: underline;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 800px) {
  #dashboard-section > * {
    flex-direction: column;
  }

  .chart-container,
  #table-container {
    padding: 12px;
  }

  .feature-card {
    flex: 1 1 100%;
  }
}
