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

.dashboard {
  display: flex;
  flex-direction: column;
  border: none;
}

/* ── Row 1: Logo + Title ──────────────────────────────────── */
.db-header {
  display: flex;
  align-items: center;
  height: 60px;
  width: 100%;
}

/* ── Row 2: Form + KPI grid ───────────────────────────────── */
.db-form-row {
  display: grid;
  grid-template-columns: 600px 1fr;  /* form fijo, KPIs ocupan el resto */
  align-items: start;
  gap: var(--gap);
  padding: var(--gap);
  width: 100%;
}

/* KPI cards: 3×2 grid of identically-sized panels */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 100%;
}

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

/* ── Row 3: Visualization (full width) ────────────────────── */
.db-viz-row {
  padding: var(--gap);
  width: 100%;
}

#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 4: Counters + PDOP + satellite bars ──────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 340px 400px 1fr;
  gap: var(--gap);
  padding: 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 {
    height: 42px;
  }
  .area-logo { width: 120px; }
  .area-title { padding-right: 120px; }
  .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-grid     { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 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 (< 800 px) ────────────────────────────────────── */
@media (max-width: 800px) {
  .db-header { height: 38px; }
  .area-logo { display: none; }
  .area-title { padding-right: 0; }
  .kpi-grid  { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 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); }
}
