/* SALINAS METHOD · Q6.9.7 HF.1.18E REV4 FIX2
   Mobile/PWA/TWA UX repair: navigation, scroll and responsive data views.
   Desktop, manifest, SW, Push, DB, memberships and Stripe logic are outside scope.
*/

.hf118e-rev4-fix2-sheet[hidden]{display:none !important;}

@media (max-width:980px){
  html.hf118e-rev4-fix2-admin{
    width:100%;
    min-height:100%;
    overflow-x:hidden !important;
    overflow-y:auto;
    overscroll-behavior-y:auto;
  }

  html.hf118e-rev4-fix2-admin body{
    width:100%;
    max-width:100%;
    min-height:100dvh;
    height:auto;
    overflow-x:hidden !important;
    overscroll-behavior-y:auto;
    touch-action:pan-y;
    -webkit-overflow-scrolling:touch;
  }

  html.hf118e-rev4-fix2-admin .admin-shell{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:100dvh !important;
    height:auto !important;
    margin:0 !important;
    padding:0 10px calc(34px + env(safe-area-inset-bottom)) !important;
    overflow:visible !important;
  }

  html.hf118e-rev4-fix2-admin .admin-side,
  html.hf118e-rev4-fix2-admin .admin-top{
    display:none !important;
  }

  html.hf118e-rev4-fix2-admin .admin-main{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:100dvh !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }

  html.hf118e-rev4-fix2-admin .admin-mobile-head{
    position:sticky !important;
    top:0;
    z-index:1200;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    min-height:58px;
    margin:0 -1px 10px !important;
    padding:7px 1px !important;
    background:linear-gradient(180deg,rgba(6,6,6,.99),rgba(6,6,6,.94));
    border-bottom:1px solid rgba(226,181,78,.14);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
  }

  html.hf118e-rev4-fix2-standalone.hf118e-rev4-fix2-admin .admin-mobile-head{
    padding-top:max(7px,env(safe-area-inset-top)) !important;
  }

  html.hf118e-rev4-fix2-admin #mobileAdminNav{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    min-width:0 !important;
    min-height:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
    overflow:hidden !important;
    clip-path:inset(50%) !important;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-button{
    appearance:none;
    width:100%;
    min-width:0;
    height:48px;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto;
    align-items:center;
    column-gap:10px;
    padding:7px 13px 6px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:14px;
    background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
    color:#f6f3ed;
    text-align:left;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-button small{
    grid-column:1;
    grid-row:1;
    margin:0;
    color:#b38c38;
    font-size:9px;
    line-height:1;
    font-weight:900;
    letter-spacing:.18em;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-button strong{
    grid-column:1;
    grid-row:2;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:15px;
    line-height:1.2;
    font-weight:800;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-chevron{
    grid-column:2;
    grid-row:1 / 3;
    align-self:center;
    color:#dcb04b;
    font-size:18px;
    line-height:1;
    transition:transform .18s ease;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-button[aria-expanded="true"] .hf118e-rev4-fix2-chevron{
    transform:rotate(180deg);
  }

  html.hf118e-rev4-fix2-admin .admin-mobile-head > .portal-link,
  html.hf118e-rev4-fix2-admin .admin-mobile-head > button[onclick*="smAdminLogout"]{
    width:auto !important;
    min-width:64px !important;
    height:48px !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    margin:0 !important;
    padding:0 13px !important;
    border:1px solid rgba(224,175,66,.30) !important;
    border-radius:14px !important;
    background:rgba(255,255,255,.025) !important;
    color:#e8c56f !important;
    font-size:13px !important;
    line-height:1 !important;
    font-weight:800 !important;
    text-decoration:none !important;
  }

  html.hf118e-rev4-fix2-admin .admin-pane,
  html.hf118e-rev4-fix2-admin .admin-pane > *,
  html.hf118e-rev4-fix2-admin .portal-card,
  html.hf118e-rev4-fix2-admin form{
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }

  html.hf118e-rev4-fix2-admin .admin-pane{
    width:100% !important;
    overflow:visible !important;
  }

  html.hf118e-rev4-fix2-admin .admin-pane *{
    min-width:0;
    overflow-wrap:anywhere;
  }

  html.hf118e-rev4-fix2-admin input,
  html.hf118e-rev4-fix2-admin select,
  html.hf118e-rev4-fix2-admin textarea,
  html.hf118e-rev4-fix2-admin button,
  html.hf118e-rev4-fix2-admin img,
  html.hf118e-rev4-fix2-admin video,
  html.hf118e-rev4-fix2-admin iframe{
    max-width:100%;
    box-sizing:border-box;
  }

  /* Summary is useful at a glance and no longer consumes one full screen per card. */
  html.hf118e-rev4-fix2-admin .admin-summary{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px !important;
  }

  html.hf118e-rev4-fix2-admin .admin-summary > :last-child:nth-child(odd){grid-column:1 / -1;}

  html.hf118e-rev4-fix2-admin .admin-stat{
    min-height:104px !important;
    padding:14px !important;
    border-radius:17px !important;
  }

  html.hf118e-rev4-fix2-admin .admin-stat > span{font-size:9px !important;letter-spacing:.12em !important;}
  html.hf118e-rev4-fix2-admin .admin-stat > strong{margin-top:7px !important;font-size:30px !important;line-height:1 !important;}
  html.hf118e-rev4-fix2-admin .admin-stat > small{margin-top:7px !important;font-size:12px !important;line-height:1.25 !important;}

  /* Client tabs and filters: compact and touch-friendly. */
  html.hf118e-rev4-fix2-admin .q691-client-tabs{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:6px !important;
    padding:6px !important;
    border-radius:18px !important;
  }

  html.hf118e-rev4-fix2-admin .q691-client-tabs button{
    min-height:48px !important;
    height:auto !important;
    padding:10px 8px !important;
    white-space:normal !important;
    line-height:1.2 !important;
    text-align:center !important;
  }

  html.hf118e-rev4-fix2-admin .admin-toolbar,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i,
  html.hf118e-rev4-fix2-admin .prive-request-toolbar{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px !important;
    padding:13px !important;
  }

  html.hf118e-rev4-fix2-admin .admin-toolbar .admin-search,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i .admin-search{
    grid-column:1 / -1;
    width:100% !important;
  }

  html.hf118e-rev4-fix2-admin .admin-toolbar input,
  html.hf118e-rev4-fix2-admin .admin-toolbar select,
  html.hf118e-rev4-fix2-admin .admin-toolbar button,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i input,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i select,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i button{
    width:100% !important;
    min-height:46px !important;
    margin:0 !important;
  }

  /* Dynamic desktop rows become vertical mobile cards using the existing data-label contract. */
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-header{
    display:none !important;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-card{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 0 10px !important;
    padding:15px !important;
    border:1px solid rgba(255,255,255,.09) !important;
    border-radius:18px !important;
    background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.018)) !important;
    box-sizing:border-box !important;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field{
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    max-width:100% !important;
    margin:0 !important;
    padding:0 !important;
    position:static !important;
    transform:none !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    line-height:1.25 !important;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field::before{
    content:attr(data-label);
    display:block;
    margin:0 0 5px;
    color:#928d84;
    font-size:9px;
    line-height:1.1;
    font-weight:850;
    letter-spacing:.12em;
    text-transform:uppercase;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Cliente"],
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Acción"],
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Accion"]{
    grid-column:1 / -1;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field button,
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field .portal-btn{
    min-height:42px !important;
    width:100% !important;
    justify-content:center !important;
  }

  /* Other module grids/forms must fold instead of overflowing the phone. */
  html.hf118e-rev4-fix2-admin .prive-request-stats,
  html.hf118e-rev4-fix2-admin .q695-private-followup-grid,
  html.hf118e-rev4-fix2-admin .content-editor-grid,
  html.hf118e-rev4-fix2-admin .recipe-editor-grid,
  html.hf118e-rev4-fix2-admin .q695-staff-fields,
  html.hf118e-rev4-fix2-admin .q695-permission-grid,
  html.hf118e-rev4-fix2-admin .q68-users-layout,
  html.hf118e-rev4-fix2-admin .q695-users-layout,
  html.hf118e-rev4-fix2-admin .q694-video-grid,
  html.hf118e-rev4-fix2-admin .admin-checkin-viewer-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    max-width:100% !important;
  }

  html.hf118e-rev4-fix2-admin .content-list-head,
  html.hf118e-rev4-fix2-admin .content-command-bar,
  html.hf118e-rev4-fix2-admin .content-manager-head,
  html.hf118e-rev4-fix2-admin .admin-note-actions,
  html.hf118e-rev4-fix2-admin .q694-upload-row,
  html.hf118e-rev4-fix2-admin .q696-video-preview-head{
    flex-wrap:wrap !important;
    gap:10px !important;
  }

  html.hf118e-rev4-fix2-admin .content-list-head > *,
  html.hf118e-rev4-fix2-admin .content-command-bar > *,
  html.hf118e-rev4-fix2-admin .content-manager-head > *{
    min-width:0 !important;
  }

  /* Module sheet stays internally scrollable; closing always releases the root lock in JS. */
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet{
    position:fixed;
    inset:0;
    z-index:6000;
    touch-action:auto;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-backdrop{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
    border-radius:0;
    background:rgba(0,0,0,.72);
    backdrop-filter:blur(5px);
    -webkit-backdrop-filter:blur(5px);
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-dialog{
    position:absolute;
    left:10px;
    right:10px;
    bottom:max(10px,env(safe-area-inset-bottom));
    max-height:min(78dvh,680px);
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:16px;
    border:1px solid rgba(226,181,78,.20);
    border-radius:24px;
    background:radial-gradient(circle at 90% 0,rgba(201,53,118,.09),transparent 42%),linear-gradient(180deg,#11100f,#080808);
    box-shadow:0 28px 70px rgba(0,0,0,.6);
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-head small{display:block;color:#dcb04b;font-size:9px;font-weight:900;letter-spacing:.18em;}
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-head h2{margin:5px 0 0;font-size:21px;line-height:1;}

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-sheet-close{
    flex:0 0 40px;
    width:40px;
    height:40px;
    padding:0;
    border:1px solid rgba(255,255,255,.11);
    border-radius:12px;
    background:rgba(255,255,255,.03);
    color:#f5f2eb;
    font-size:22px;
    line-height:1;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-item{
    min-height:54px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:10px 12px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:14px;
    background:rgba(255,255,255,.025);
    color:#e9e5dd;
    text-align:left;
    font-size:13px;
    line-height:1.2;
    font-weight:750;
  }

  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-item::after{content:"›";flex:0 0 auto;color:#8d8a84;font-size:18px;}
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-item.is-current{border-color:rgba(222,177,73,.55);background:linear-gradient(135deg,rgba(222,177,73,.13),rgba(195,50,112,.06));color:#f0cb72;}
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-item.is-current::after{color:#e1b64f;}

  html.hf118e-rev4-fix2-admin.hf118e-rev4-fix2-menu-open,
  html.hf118e-rev4-fix2-admin.hf118e-rev4-fix2-menu-open body{
    overflow:hidden !important;
  }
}

@media (max-width:560px){
  html.hf118e-rev4-fix2-admin .admin-toolbar,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i,
  html.hf118e-rev4-fix2-admin .prive-request-toolbar,
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-card,
  html.hf118e-rev4-fix2-admin .prive-request-stats,
  html.hf118e-rev4-fix2-admin .q695-private-followup-grid,
  html.hf118e-rev4-fix2-admin .content-editor-grid,
  html.hf118e-rev4-fix2-admin .recipe-editor-grid,
  html.hf118e-rev4-fix2-admin .q695-staff-fields,
  html.hf118e-rev4-fix2-admin .q695-permission-grid,
  html.hf118e-rev4-fix2-admin .q68-users-layout,
  html.hf118e-rev4-fix2-admin .q695-users-layout,
  html.hf118e-rev4-fix2-admin .q694-video-grid,
  html.hf118e-rev4-fix2-admin .admin-checkin-viewer-grid{
    grid-template-columns:1fr !important;
  }

  html.hf118e-rev4-fix2-admin .admin-toolbar > *,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i > *,
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field,
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Cliente"],
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Acción"],
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-data-field[data-label="Accion"]{
    grid-column:auto !important;
  }

  html.hf118e-rev4-fix2-admin .admin-toolbar .admin-search,
  html.hf118e-rev4-fix2-admin .admin-toolbar-i .admin-search{
    grid-column:1 !important;
  }

  html.hf118e-rev4-fix2-admin .content-manager-head{
    padding:14px !important;
  }

  html.hf118e-rev4-fix2-admin .content-manager-head h2{
    font-size:clamp(21px,7vw,28px) !important;
    line-height:1.08 !important;
  }
}

@media (max-width:360px){
  html.hf118e-rev4-fix2-admin .admin-summary,
  html.hf118e-rev4-fix2-admin .hf118e-rev4-fix2-module-grid{
    grid-template-columns:1fr !important;
  }
  html.hf118e-rev4-fix2-admin .admin-summary > :last-child:nth-child(odd){grid-column:auto;}
  html.hf118e-rev4-fix2-admin .admin-mobile-head > .portal-link,
  html.hf118e-rev4-fix2-admin .admin-mobile-head > button[onclick*="smAdminLogout"]{min-width:58px !important;padding:0 10px !important;}
}

/* Login/admin-login: phone starts with the account form, not a full-screen marketing card. */
@media (max-width:760px){
  html.hf118e-rev4-fix2-auth .hf118e-rev4-fix2-auth-intro{
    display:none !important;
  }

  html.hf118e-rev4-fix2-auth .site-header{min-height:56px !important;}
  html.hf118e-rev4-fix2-auth .site-header .nav{min-height:56px !important;padding-top:7px !important;padding-bottom:7px !important;gap:8px !important;}
  html.hf118e-rev4-fix2-auth .site-header .brand-logo,
  html.hf118e-rev4-fix2-auth .portal-brand img{width:36px !important;height:36px !important;}
  html.hf118e-rev4-fix2-auth .site-header .brand strong,
  html.hf118e-rev4-fix2-auth .portal-brand strong{font-size:11px !important;letter-spacing:.16em !important;}

  html.hf118e-rev4-fix2-auth .hf118e-rev4-fix2-back-to-web{
    min-height:38px !important;
    height:38px !important;
    padding:0 11px !important;
    border-radius:12px !important;
    font-size:12px !important;
  }

  html.hf118e-rev4-fix2-auth.hf118e-rev4-fix2-standalone .site-header .nav-actions,
  html.hf118e-rev4-fix2-auth.hf118e-rev4-fix2-standalone .hf118e-rev4-fix2-back-to-web{
    display:none !important;
  }

  html.hf118e-rev4-fix2-auth main{
    padding-top:8px !important;
  }
}
