/*
 * Ajustes móviles compartidos.
 *
 * Este archivo se carga después de los estilos generales para adaptar controles
 * anchos sin cambiar su comportamiento en escritorio. Los calendarios y tablas
 * conservan su ancho útil dentro de una región desplazable táctil.
 */
.view-as-mobile,
.dashboard-scroll-hint {
  display: none;
}

.dashboard-main-grid > *,
.dashboard-section,
.dashboard-agenda {
  min-width: 0;
}

.dashboard-agenda-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}

.dashboard-agenda-scroll .dashboard-agenda-grid {
  min-width: 625px;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

@media (max-width: 700px) {
  .topbar {
    height: 76px !important;
    min-height: 76px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px;
  }

  .brand {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    gap: 0;
  }

  .brand-logo {
    flex: 0 0 auto;
    width: 34px;
    height: 42px;
    object-fit: contain;
  }

  .brand span:last-child {
    display: none !important;
  }

  .view-as-toolbar {
    display: none !important;
  }

  .view-as-mobile {
    position: relative;
    display: block;
    flex: 0 1 auto;
  }

  .view-as-mobile > summary {
    display: block;
    max-width: 112px;
    min-height: 44px;
    padding: 12px 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    background: #fff;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
  }

  .view-as-mobile > summary::-webkit-details-marker {
    display: none;
  }

  .view-as-mobile-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 4px;
    width: min(260px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(8, 13, 55, .25);
  }

  .view-as-mobile-menu form {
    margin: 0;
  }

  .view-as-mobile-menu .view-as-button {
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    text-align: left;
  }

  .view-as-mobile-menu .view-as-button:hover,
  .view-as-mobile-menu .view-as-button:focus,
  .view-as-mobile-menu .view-as-button.active {
    background: #e8eafd;
    color: var(--blue);
  }

  .view-as-mobile-group-label {
    padding: 6px 8px 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .nav-toggle {
    display: block;
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
    margin-right: auto;
  }

  .notification-center {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .notification-center > summary {
    width: 42px;
  }

  .content > * {
    min-width: 0;
  }

  .panel,
  .dashboard-section,
  .dashboard-hero,
  .table-wrap {
    max-width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    max-width: 100%;
    min-width: 0;
  }

  .panel-head,
  .dashboard-section-head {
    flex-wrap: wrap;
  }

  .screen-help-button {
    right: 12px;
    bottom: 12px;
    width: 52px;
    min-height: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .screen-help-label,
  .screen-help-button small {
    display: none;
  }

  .dashboard-hero-copy {
    min-width: 0;
    padding: 26px 20px;
  }

  .dashboard-hero h1 {
    font-size: clamp(32px, 10vw, 44px);
    line-height: 1.04;
    overflow-wrap: break-word;
  }

  .dashboard-hero > img {
    pointer-events: none;
  }
}

@media (max-width: 520px) {
  .view-as-mobile > summary {
    max-width: 108px;
  }
}

@media (max-width: 760px) {
  .dashboard-scroll-hint {
    display: block;
    margin: -5px 0 9px;
    color: var(--muted);
    font-size: 11px;
  }

  .dashboard-agenda-scroll {
    scroll-snap-type: x proximity;
  }

  .dashboard-agenda-scroll .dashboard-agenda-grid {
    width: max-content;
    min-width: 725px;
    grid-template-columns: repeat(5, 145px);
  }

  .dashboard-agenda-day {
    scroll-snap-align: start;
  }
}
