/* 13-11-2026: cabecera en el móvil: escudo y nombre en una fila, a la izquierda, y el usuario y el buzón
   a la derecha (antes el escudo quedaba descentrado y la cabecera ocupaba media pantalla). */
@media (max-width: 600px) {
  header {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
  }
  header .logo-title {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    margin-right: auto !important;
    flex: 1 1 0;      /* se encoge para que el usuario y el buzón quepan en la misma fila */
    min-width: 0;
  }
  header .logo-title img {
    height: 40px !important;
    width: auto !important;
    margin: 0 !important;
  }
  header .logo-title h1 {
    font-size: 0.85em !important;
    overflow-wrap: anywhere;
    line-height: 1.25 !important;
    text-align: left !important;
    margin: 0 !important;
  }
  header .user-area {
    margin: 0 !important;
    gap: 6px !important;
    flex-shrink: 0;
  }
  header .user-toggle {
    padding: 3px !important;
    gap: 0 !important;
  }
  header .user-toggle .dropdown-arrow-user { display: none !important; }
  header .user-avatar { width: 36px !important; height: 36px !important; }
  header .mailbox-container { margin-left: 0 !important; }
  header .mailbox-icon { width: 38px !important; height: 38px !important; }
  /* El usuario queda a la derecha: su desplegable se alinea a la derecha */
  header .user-menu .user-dropdown { left: auto !important; right: 0 !important; }
  /* Sin sesión: los tres enlaces en una fila debajo del nombre */
  header .guest-links {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 6px !important;
    width: 100%;
    justify-content: flex-start;
  }
  header .user-area:has(.guest-links:not([style*="none"])) { width: 100%; flex-basis: 100%; }
  header .guest-links a {
    padding: 6px 12px !important;
    font-size: 0.85em !important;
  }
}

/* 13-11-2026: textos largos y campos que se salían de la pantalla en el móvil
   (resumen de las solicitudes, nombres de archivo largos, campo de fecha del iPhone). */
.data-value, .file-name, .file-details, .file-details strong, .file-upload-text,
.file-item > div, .resumen-solicitud, .alert {
  overflow-wrap: anywhere;
  min-width: 0;
}
.file-info, .file-item { min-width: 0; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  body { overflow-x: clip; }                 /* red de seguridad: nada desplaza la página de lado */
  .data-row {
    flex-direction: column !important;       /* etiqueta encima y valor debajo */
    align-items: flex-start !important;
    gap: 2px;
  }
  .data-row .data-label { font-size: 0.9em; }
  .data-row .data-value { text-align: left !important; width: 100%; }
  /* El iPhone dibuja la fecha a su manera: gris, centrada y más ancha que la pantalla */
  input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100% !important;
    min-height: 46px;
    background-color: #fff;
    color: inherit;
    text-align: left;
  }
  input[type="date"]::-webkit-date-and-time-value,
  input[type="time"]::-webkit-date-and-time-value,
  input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
}
