/* ============================================================================
 * layout.css — Estructura de la ventana: barra de título, marcos "Consulta" /
 * "Resultados" (LabelFrame), barra inferior y notas de demo.
 * ========================================================================== */

.page {
  min-height: 100vh;
  padding: 34px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* -- Ventana de la "aplicación" ------------------------------------------------ */
.app-window {
  width: 850px;             /* geometry por defecto 850x600 de la app real */
  min-width: 850px;
  max-width: calc(100vw - 32px);
  min-height: 600px;
  background: var(--win-bg);
  border: 1px solid #9a9a9a;
  border-radius: 7px 7px 4px 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  position: relative;       /* ancla del badge DEMO (sobresale por arriba) */
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(#ffffff, #f2f2f2);
  border-bottom: 1px solid var(--win-border);
  border-radius: 6px 6px 0 0;
  padding: 6px 4px 6px 12px;
  user-select: none;
}
.titlebar .titlebar-text {
  font-size: 12px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.titlebar-close {
  border: none;
  background: transparent;
  font-size: 13px;
  width: 42px;
  height: 24px;
  cursor: pointer;
  color: #333;
  border-radius: 0 6px 0 0;
}
.titlebar-close:hover { background: #e81123; color: #fff; }

.app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-bottom: 0;
}

/* -- LabelFrame genérico --------------------------------------------------------- */
.lframe {
  border: 1px solid var(--win-border);
  border-radius: 4px;
  margin: 12px 12px 6px;
  padding: 12px;
  position: relative;
  background: var(--win-bg);
}
.lframe > .lframe-label {
  position: absolute;
  top: -9px;
  left: 10px;
  background: var(--win-bg);
  padding: 0 5px;
  font-size: 12px;
  color: #333;
}

/* -- Marco "Consulta" -------------------------------------------------------------- */
.consulta .row { display: flex; align-items: center; flex-wrap: wrap; }
.consulta .row-modes { gap: 14px; margin-bottom: 6px; }
.consulta .row-dates { margin: 4px 0; min-height: 26px; color: #333; }
.consulta .row-quick { margin-top: 8px; gap: 4px; }
.consulta .row-quick .quick-caption { margin-right: 6px; color: #333; }
.consulta .row-actions { margin-top: 10px; gap: 6px; align-items: center; }

.today-label { color: #333; }

.range-frame, .month-frame { display: flex; align-items: center; gap: 4px; }
.range-frame .lbl-desde { margin-right: 4px; }
.range-frame .lbl-hasta { margin: 0 4px 0 14px; }
.month-frame .lbl-anno { margin: 0 4px 0 14px; }

.date-entry { display: inline-flex; align-items: center; gap: 2px; }
.date-sep { padding: 0 2px; color: #333; }

/* -- Marco "Resultados" ------------------------------------------------------------ */
.resultados {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding: 12px 6px 6px;
  min-height: 260px;
}
#tableContainer { flex: 1; display: flex; min-height: 0; }

/* -- Barra inferior --------------------------------------------------------------------- */
.bottombar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 12px;
}
.bottombar .spacer { flex: 1; }
#countLabel { color: var(--color-neutral); margin: 0 12px; white-space: nowrap; }
#cacheLabel {
  color: var(--color-muted);
  margin: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}
#cacheLabel:hover { text-decoration: underline; }

/* -- Responsive básico ------------------------------------------------------------------------ */
@media (max-width: 920px) {
  .app-window { min-width: 0; width: 100%; }
  .bottombar { flex-wrap: wrap; }
}
