/* ============================================================================
   Tik Tak PASS — DEV 1.2.155H19
   CSS HAUT DROITE — TABLETTE
   ============================================================================
   PROPRIÉTAIRE UNIQUE DE LA GÉOMÉTRIE ET DU CADRE HD TABLETTE.
   H15 conserve le nettoyage H13/H14 et affine la référence visuelle HÔTESSE :
   commandes à gauche / PRÊT-OCCUPÉ à droite.
   Aucun CSS métier ne doit repositionner/redimensionner ces éléments en tablette.
   ============================================================================ */
@media (orientation:landscape) and (min-width:900px) {
  body.device-tablet {
    --tt-hd-control-h:40px;
    --tt-hd-card-h:48px;
    --tt-hd-module-w:128px;
    --tt-hd-square:40px;
    --tt-hd-status-cluster-w:132px;
    --tt-hd-simulation-w:142px;
    --tt-hd-stat-action-w:108px;
    --tt-hd-gap:4px;
    --tt-hd-radius:12px;
    --tt-hd-pad-left:6px;
    --tt-hd-pad-right:4px;
    --tt-hd-ready-w:var(--tt-tablet-status-width);
    --tt-hd-ready-inset:2px;
    --tt-hd-separator-width:1px;
    --tt-hd-separator-color:#fff;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD {
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) var(--tt-hd-ready-w) !important;
    grid-template-rows:minmax(0,1fr) !important;
    column-gap:0 !important;
    row-gap:0 !important;
    align-items:stretch !important;
    overflow:hidden !important;
    position:relative !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD::before {
    content:"" !important;
    position:absolute !important;
    z-index:20 !important;
    pointer-events:none !important;
    top:0 !important;
    bottom:0 !important;
    right:calc(var(--tt-hd-ready-w) - (var(--tt-hd-separator-width) / 2)) !important;
    width:var(--tt-hd-separator-width) !important;
    background:var(--tt-hd-separator-color) !important;
    opacity:var(--tt-layout-debug-opacity,1) !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD > .ttZone0 {
    grid-column:1 !important;
    grid-row:1 !important;
    box-sizing:border-box !important;
    width:calc(100% - 5px) !important;
    min-width:0 !important;
    height:var(--tt-hd-card-h) !important;
    min-height:var(--tt-hd-card-h) !important;
    max-height:var(--tt-hd-card-h) !important;
    margin:auto 5px auto 0 !important;
    padding:4px var(--tt-hd-pad-right) 4px var(--tt-hd-pad-left) !important;
    border:1px solid var(--line) !important;
    border-radius:var(--tt-hd-radius) !important;
    background:var(--tt-mep-panel-bg) !important;
    box-shadow:none !important;
    overflow:hidden !important;
    display:flex !important;
    align-items:center !important;
    justify-content:stretch !important;
    position:static !important;
    inset:auto !important;
    transform:none !important;
  }
  body[data-theme="dark"].device-tablet .ttModuleFrame > .ttZoneHD > .ttZone0 {
    background:var(--tt-mep-panel-bg) !important;
    border-color:#3a4654 !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions {
    box-sizing:border-box !important;
    display:grid !important;
    width:100% !important;
    min-width:0 !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    margin:0 !important;
    padding:0 !important;
    column-gap:var(--tt-hd-gap) !important;
    row-gap:0 !important;
    align-items:center !important;
    justify-items:stretch !important;
    justify-content:stretch !important;
    justify-self:stretch !important;
    align-content:center !important;
    max-width:none !important;
    overflow:hidden !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD > .ttOperationalStatus {
    grid-column:2 !important;
    grid-row:1 !important;
    position:static !important;
    inset:auto !important;
    box-sizing:border-box !important;
    width:calc(100% - (2 * var(--tt-hd-ready-inset))) !important;
    min-width:0 !important;
    max-width:none !important;
    height:var(--tt-hd-card-h) !important;
    min-height:var(--tt-hd-card-h) !important;
    max-height:var(--tt-hd-card-h) !important;
    margin:0 !important;
    border-radius:var(--tt-hd-radius) !important;
    align-self:center !important;
    justify-self:center !important;
    transform:none !important;
    overflow:hidden !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions button,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions label,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions select,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions .controlTile,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions .hostessSyncBadge,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions .workspaceSyncBadge,
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttZone0Actions .statisticsSyncBadge {
    box-sizing:border-box !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    margin:0 !important;
    padding-top:0 !important;
    padding-bottom:0 !important;
    border-radius:var(--tt-hd-radius) !important;
    line-height:1 !important;
    align-self:center !important;
    transform:none !important;
    top:auto !important;
    bottom:auto !important;
  }

  body.device-tablet #moduleBtn,
  body.device-tablet #hostessModuleBtn,
  body.device-tablet #statisticsBackBtn,
  body.device-tablet #gestionModuleBtn,
  body.device-tablet #adminModuleBtn {
    width:var(--tt-hd-module-w) !important;
    min-width:var(--tt-hd-module-w) !important;
    max-width:var(--tt-hd-module-w) !important;
    padding:0 12px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    font-size:10px !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD .ttQuickFullscreenBtn {
    box-sizing:border-box !important;
    width:var(--tt-hd-square) !important;
    min-width:var(--tt-hd-square) !important;
    max-width:var(--tt-hd-square) !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    padding:0 !important;
    border-radius:var(--tt-hd-radius) !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:16px !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD .ttStatusClusterHost,
  body.device-tablet #syncBadge,
  body.device-tablet #hostessSyncBadge,
  body.device-tablet #statisticsSyncBadge,
  body.device-tablet #gestionSyncBadge,
  body.device-tablet #adminSyncBadge {
    box-sizing:border-box !important;
    width:var(--tt-hd-status-cluster-w) !important;
    min-width:var(--tt-hd-status-cluster-w) !important;
    max-width:var(--tt-hd-status-cluster-w) !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    margin:0 !important;
    padding:4px !important;
    border:1px solid var(--line) !important;
    border-radius:var(--tt-hd-radius) !important;
    background:rgba(18,69,54,.22) !important;
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:3px !important;
    align-items:stretch !important;
    justify-self:end !important;
    align-self:center !important;
  }
  body[data-theme="dark"].device-tablet .ttModuleFrame > .ttZoneHD .ttStatusClusterHost,
  body[data-theme="dark"].device-tablet #syncBadge,
  body[data-theme="dark"].device-tablet #hostessSyncBadge,
  body[data-theme="dark"].device-tablet #statisticsSyncBadge,
  body[data-theme="dark"].device-tablet #gestionSyncBadge,
  body[data-theme="dark"].device-tablet #adminSyncBadge {
    border-color:#355548 !important;
    background:#16241f !important;
  }

  body.device-tablet .ttModuleFrame > .ttZoneHD .ttStatusClusterHost .ttStatusPill {
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    height:100% !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
  body.device-tablet .ttModuleFrame > .ttZoneHD .ttStatusClusterHost .ttStatusIcon {
    width:20px !important;
    height:20px !important;
    flex:0 0 20px !important;
  }

  body.device-tablet #app.ttModuleFrame > .ttZoneHD > #controlCard.ttZone0 {
    grid-column:1 !important;
    grid-row:1 !important;
    /* H26 : le cadran HD CAISSE doit rendre exactement le même fond que TYPE DE VENTE.
       Ce sélecteur volontairement spécifique neutralise les anciens #controlCard clairs/sombres
       de CSS_10_Caisse sans toucher au téléphone. */
    background:var(--tt-mep-panel-bg) !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #controlCard > .controlGrid.ttZone0Actions {
    display:grid !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    justify-content:stretch !important;
    justify-self:stretch !important;
    flex:none !important;
    grid-template-columns:var(--tt-hd-module-w) var(--tt-hd-square) minmax(0,1fr) var(--tt-hd-simulation-w) var(--tt-hd-status-cluster-w) !important;
  }
  body.device-tablet #moduleBtn{grid-column:1 !important;}
  body.device-tablet #caisseQuickFullscreenBtn{grid-column:2 !important;}
  body.device-tablet #simulationControl{
    grid-column:4 !important;
    width:var(--tt-hd-simulation-w) !important;
    min-width:var(--tt-hd-simulation-w) !important;
    max-width:var(--tt-hd-simulation-w) !important;
    padding:0 10px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;
    font-size:10px !important;
    justify-self:end !important;
  }
  body.device-tablet #syncBadge{grid-column:5 !important;}
  body.device-tablet #app.ttModuleFrame > .ttZoneHD > #cashierStatus.ttOperationalStatus {
    grid-column:2 !important;
    grid-row:1 !important;
    font-size:10px !important;
    line-height:1 !important;
    letter-spacing:0 !important;
  }

  body.device-tablet .hostessFrame.ttModuleFrame > .ttZoneHD .hostessControlGrid.ttZone0Actions,
  body.device-tablet .workspaceFrame.ttModuleFrame > .ttZoneHD .workspaceControlRow.ttZone0Actions {
    grid-template-columns:var(--tt-hd-module-w) var(--tt-hd-square) minmax(0,1fr) var(--tt-hd-status-cluster-w) !important;
  }
  body.device-tablet #hostessModuleBtn,
  body.device-tablet #gestionModuleBtn,
  body.device-tablet #adminModuleBtn{grid-column:1 !important;}
  body.device-tablet #hostessQuickFullscreenBtn,
  body.device-tablet #gestionQuickFullscreenBtn,
  body.device-tablet #adminQuickFullscreenBtn{grid-column:2 !important;}
  body.device-tablet #hostessSyncBadge,
  body.device-tablet #gestionSyncBadge,
  body.device-tablet #adminSyncBadge{grid-column:4 !important;}

  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsBackRow,
  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsUtilityRow {display:contents !important;}
  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsUnifiedActions.ttZone0Actions {
    grid-template-columns:var(--tt-hd-module-w) var(--tt-hd-square) minmax(0,1fr) var(--tt-hd-stat-action-w) var(--tt-hd-stat-action-w) var(--tt-hd-stat-action-w) var(--tt-hd-stat-action-w) var(--tt-hd-status-cluster-w) !important;
  }
  body.device-tablet #statisticsBackBtn{grid-column:1 !important;}
  body.device-tablet #statisticsQuickFullscreenBtn{grid-column:2 !important;}
  body.device-tablet #statisticsRefreshBtn,
  body.device-tablet #statisticsGeneralBtn,
  body.device-tablet #statisticsDetailBtn,
  body.device-tablet #statisticsCommissionBtn{
    width:var(--tt-hd-stat-action-w) !important;
    min-width:var(--tt-hd-stat-action-w) !important;
    max-width:var(--tt-hd-stat-action-w) !important;
    padding:0 8px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:10px !important;
  }
  body.device-tablet #statisticsRefreshBtn{grid-column:4 !important;}
  body.device-tablet #statisticsGeneralBtn{grid-column:5 !important;}
  body.device-tablet #statisticsDetailBtn{grid-column:6 !important;}
  body.device-tablet #statisticsCommissionBtn{grid-column:7 !important;}
  body.device-tablet #statisticsSyncBadge{grid-column:8 !important;}
  body.device-tablet #statisticsLogoutBtn,
  body.device-tablet #statisticsViewSelect{display:none !important;}
}


/* H18 — CAISSE : ancrage visuel garanti gauche/droite dans le cadran HD. */
@media (orientation:landscape) and (min-width:900px) {
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #controlCard > .controlGrid.ttZone0Actions {
    position:relative !important;
    display:block !important;
    width:100% !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    overflow:visible !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #moduleBtn,
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #caisseQuickFullscreenBtn,
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #simulationControl,
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #syncBadge {
    position:absolute !important;
    top:0 !important;
    bottom:auto !important;
    margin:0 !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #moduleBtn {
    left:0 !important; right:auto !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #caisseQuickFullscreenBtn {
    left:calc(var(--tt-hd-module-w) + var(--tt-hd-gap)) !important; right:auto !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #syncBadge {
    right:0 !important; left:auto !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #simulationControl {
    right:calc(var(--tt-hd-status-cluster-w) + var(--tt-hd-gap)) !important; left:auto !important;
  }
}


/* H19 — CAISSE : affinage demandé par Alain après capture H18. */
@media (orientation:landscape) and (min-width:900px) {
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #moduleBtn .ttTopMenuArrow {
    transform:translateY(-0.24em) !important;
    margin-right:.18em !important;
  }
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #syncBadge.ttStatusClusterHost .ttStatusPill,
  body.device-tablet #app.ttModuleFrame > .ttZoneHD #syncBadge .ttStatusPill {
    border-radius:calc(var(--tt-hd-radius) - 4px) !important;
  }
}

/* H21 — CAISSE : PRÊT/OCCUPÉ utilise la même échelle typographique (10 px) que MODULES et SIMULATION. */


/* H28 — harmonisation robuste multi-modules : même moteur d’ancrage que CAISSE.
   Les commandes HD tablette ne dépendent plus du grid legacy des modules. */
@media (orientation:landscape) and (min-width:900px) {
  body.device-tablet .hostessFrame.ttModuleFrame > .ttZoneHD .hostessControlGrid.ttZone0Actions,
  body.device-tablet .workspaceFrame.ttModuleFrame > .ttZoneHD .workspaceControlRow.ttZone0Actions,
  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsUnifiedActions.ttZone0Actions {
    position:relative !important;
    display:block !important;
    width:100% !important;
    height:var(--tt-hd-control-h) !important;
    min-height:var(--tt-hd-control-h) !important;
    max-height:var(--tt-hd-control-h) !important;
    overflow:visible !important;
  }

  body.device-tablet #hostessModuleBtn,
  body.device-tablet #hostessQuickFullscreenBtn,
  body.device-tablet #hostessSyncBadge,
  body.device-tablet #gestionModuleBtn,
  body.device-tablet #gestionQuickFullscreenBtn,
  body.device-tablet #gestionSyncBadge,
  body.device-tablet #adminModuleBtn,
  body.device-tablet #adminQuickFullscreenBtn,
  body.device-tablet #adminSyncBadge,
  body.device-tablet #statisticsBackBtn,
  body.device-tablet #statisticsQuickFullscreenBtn,
  body.device-tablet #statisticsSyncBadge,
  body.device-tablet #statisticsRefreshBtn,
  body.device-tablet #statisticsGeneralBtn,
  body.device-tablet #statisticsDetailBtn,
  body.device-tablet #statisticsCommissionBtn {
    position:absolute !important;
    top:0 !important;
    bottom:auto !important;
    margin:0 !important;
  }

  body.device-tablet #hostessModuleBtn,
  body.device-tablet #gestionModuleBtn,
  body.device-tablet #adminModuleBtn,
  body.device-tablet #statisticsBackBtn { left:0 !important; right:auto !important; }

  body.device-tablet #hostessQuickFullscreenBtn,
  body.device-tablet #gestionQuickFullscreenBtn,
  body.device-tablet #adminQuickFullscreenBtn,
  body.device-tablet #statisticsQuickFullscreenBtn {
    left:calc(var(--tt-hd-module-w) + var(--tt-hd-gap)) !important;
    right:auto !important;
  }

  body.device-tablet #hostessSyncBadge,
  body.device-tablet #gestionSyncBadge,
  body.device-tablet #adminSyncBadge,
  body.device-tablet #statisticsSyncBadge { right:0 !important; left:auto !important; }

  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsBackRow,
  body.device-tablet .statisticsShell.ttModuleFrame > .ttZoneHD .statisticsUtilityRow {
    display:contents !important;
    margin:0 !important;
    padding:0 !important;
  }
  body.device-tablet #statisticsCommissionBtn {
    right:calc(var(--tt-hd-status-cluster-w) + var(--tt-hd-gap)) !important;
    left:auto !important;
  }
  body.device-tablet #statisticsDetailBtn {
    right:calc(var(--tt-hd-status-cluster-w) + (2 * var(--tt-hd-gap)) + var(--tt-hd-stat-action-w)) !important;
    left:auto !important;
  }
  body.device-tablet #statisticsGeneralBtn {
    right:calc(var(--tt-hd-status-cluster-w) + (3 * var(--tt-hd-gap)) + (2 * var(--tt-hd-stat-action-w))) !important;
    left:auto !important;
  }
  body.device-tablet #statisticsRefreshBtn {
    right:calc(var(--tt-hd-status-cluster-w) + (4 * var(--tt-hd-gap)) + (3 * var(--tt-hd-stat-action-w))) !important;
    left:auto !important;
  }

  /* STATISTIQUES possède déjà un vrai statut opérationnel dans le DOM :
     en tablette il doit être visible comme sur les quatre autres modules. */
  body.device-tablet #statisticsOperationalStatus.ttOperationalStatus {
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    font-size:10px !important;
    line-height:1 !important;
    letter-spacing:0 !important;
  }
}


/* H29 — VALIDATION PIXEL MULTI-MODULE :
   suppression de l’override HÔTESSE 132px hérité ; MODULES = 128px commun.
   Aucun changement de géométrie ajouté ailleurs. */
