/* ════════════════════════════════════════════════════════════
   Dashboard Layout — full-width, stacked rows
   ════════════════════════════════════════════════════════════ */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
  margin-left: 20px;
  margin-right: 20px;
}

/* ── Row 1: Logo + Title ──────────────────────────────────── */
.db-header {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr;
  gap: var(--gap);
  align-items: center;
}

/* ── Row 2: Form + Counters ───────────────────────────────── */
.db-form-row {
  display: grid;
  grid-template-columns: auto 1fr;   /* form toma su ancho natural */
  gap: var(--gap);
  align-items: start;
}

/* Counters: 2×2 grid */
.db-counters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  align-content: start;
}

/* ── Row 3: KPI cards ─────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}

/* ── Row 4: Visualization (full width) ───────────────────── */
#viz-container {
  display: flex;
  width: 100%;
  height: clamp(320px, 46vh, 720px);
}
#sky-div { width: 26%; height: 100%; flex-shrink: 0; }
#geo-div { flex: 1;   height: 100%; }

/* ── Row 5: PDOP + satellite bars ────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: var(--gap);
  align-items: start;
}

.sat-panels {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ── Tablet (600–960 px) ──────────────────────────────────── */
@media (max-width: 960px) {
  .db-header {
    grid-template-columns: 100px 1fr;
  }
  .db-form-row {
    grid-template-columns: 1fr;        /* form + counters stacked */
  }
  .db-counters {
    grid-template-columns: repeat(2, 1fr);  /* 2×2 en tablet también */
  }
  .kpi-row      { grid-template-columns: repeat(3, 1fr); }
  .bottom-row   { grid-template-columns: 1fr; }

  #viz-container { height: auto; flex-direction: column; }
  #sky-div { flex: none; width: 100%; height: clamp(220px, 32vh, 360px); }
  #geo-div { flex: none;             height: clamp(300px, 44vh, 540px); }
}

/* ── Mobile (< 600 px) ────────────────────────────────────── */
@media (max-width: 600px) {
  .db-header { grid-template-columns: 70px 1fr; }
  .kpi-row   { grid-template-columns: repeat(2, 1fr); }
  .db-counters { grid-template-columns: repeat(2, 1fr); }

  #sky-div { flex: none; height: clamp(200px, 35vh, 300px); }
  #geo-div { flex: none; height: clamp(260px, 45vh, 400px); }
}
