/* Inventario TRAMSI PC 0.1.1 - capa de escritorio */
@media (min-width: 1024px) {
  body { min-width: 1024px; }
  .app-shell { width: 100%; max-width: none; margin: 0; }
  .main-nav { position: sticky; top: 0; z-index: 1000; }
  .dashboard, .dashboard-content { max-width: 1680px; margin-left: auto; margin-right: auto; }
  .dashboard { padding-left: 28px; padding-right: 28px; }
  .card { border-radius: 14px; }
  .modal-card, .dialog-card { max-width: min(1180px, 92vw); max-height: 90vh; overflow: auto; }
  table { font-size: 14px; }
  th, td { white-space: normal; }

  /* Login PC: tarjeta horizontal, sin heredar altura completa de la ventana. */
  .login-view { min-height: 100vh; padding: 32px; }
  .login-stage {
    width: min(860px, calc(100vw - 64px));
    height: 518px;
    min-height: 0;
    max-height: calc(100vh - 64px);
    aspect-ratio: auto;
  }
  .login-visual { background-position: center center; background-size: cover; }
  .login-card { top: 18px; bottom: 18px; left: 18px; width: 302px; }
}
@media (min-width: 1440px) {
  .dashboard, .dashboard-content { max-width: 1800px; }
  .dashboard { padding-left: 40px; padding-right: 40px; }
}

/* Inventario TRAMSI PC 0.1.2 - estructura exclusiva de escritorio */
@media (min-width: 1024px) {
  :root { --pc-nav-height: 64px; --pc-page-gap: 24px; }

  /* La barra superior forma parte del flujo del documento. */
  body { overflow-x: hidden; }
  body:not(:has(#loginView:not(.hidden))) .app-shell {
    min-height: 100vh;
    padding: 0;
  }
  body:not(:has(#loginView:not(.hidden))) .main-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: var(--pc-nav-height);
    margin: 0;
    z-index: 1000;
  }

  /* Todos los módulos comienzan debajo del menú y conservan aire lateral. */
  body:not(:has(#loginView:not(.hidden))) .dashboard,
  body:not(:has(#loginView:not(.hidden))) .dashboard-content {
    margin-top: 0;
  }
  body:not(:has(#loginView:not(.hidden))) .dashboard:not(.dashboard-content) {
    padding-top: var(--pc-page-gap);
    padding-bottom: 48px;
  }

  /* Los modales nunca invaden la barra superior en PC. */
  body:not(:has(#loginView:not(.hidden))) .modal {
    top: var(--pc-nav-height);
    right: 0;
    bottom: 0;
    left: 0;
    padding: 20px 24px;
    place-items: center;
    z-index: 900;
    overflow: hidden;
  }
  body:not(:has(#loginView:not(.hidden))) .modal-card,
  body:not(:has(#loginView:not(.hidden))) .dialog-card {
    width: min(1180px, calc(100vw - 48px));
    max-width: min(1180px, calc(100vw - 48px));
    max-height: calc(100vh - var(--pc-nav-height) - 40px);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body:not(:has(#loginView:not(.hidden))) .modal-card.small {
    width: min(520px, calc(100vw - 48px));
  }

  /* Visores especiales también respetan la navegación. */
  body:not(:has(#loginView:not(.hidden))) .image-viewer {
    top: var(--pc-nav-height);
  }
}

/* PC: mantener el encabezado compacto sin modificar el login */
.main-nav .nav-brand img, .main-nav .nav-mobile-logo img {max-width:32px!important;max-height:32px!important;width:auto!important;height:auto!important;object-fit:contain;}
.main-nav .nav-brand {min-width:0;}

/* Solo la primera fila universal de checklist queda visible.
   Los controles antiguos permanecen en DOM para compatibilidad JS. */
#reportColumnControls,#reportKardexColumns,#reportRequestColumns,#reportOrderColumns,#reportInvoiceColumns,#reportProductColumns,#reportReturnColumns,#reportRequisitionColumns,#reportConsumptionColumns,#reportOtColumns{display:none !important;}
