/* ============================================================================
   DEV 1.2.154I — SÉLECTEUR SHOW COMMUN / TABLETTE
   AUTORITÉ UNIQUE pour l'affichage du sélecteur SHOW sur la version TABLETTE.

   Règle d'architecture :
   - CAISSE, HÔTESSE et STATISTIQUES ne définissent plus localement la géométrie
     ni l'apparence du sélecteur SHOW HTML de tablette ;
   - le téléphone conserve STRICTEMENT son CSS existant ;
   - GESTION conserve sa mécanique de recherche, mais les couleurs temporelles
     sont centralisées ici ;
   - anciens = ROUGE ; courant/proche unique = VERT ; futurs = BLEU.
   ============================================================================ */

@media (orientation:landscape) and (min-width:900px) {
  /* --------------------------------------------------------------------------
     Source de vérité masquée visuellement : le <select> natif reste utilisé par
     le JS, mais Chrome/Windows ne dessine plus son menu système sur tablette.
     -------------------------------------------------------------------------- */
  body.device-tablet #app.ttModuleFrame #showCard > #showSelect,
  body.device-tablet.module-hostess #hostessShowCard > #hostessShowSelect,
  body.device-tablet.module-statistics #statisticsPhoneSelectProxy > #statisticsShowSelect {
    display:none !important;
  }

  /* --------------------------------------------------------------------------
     Valeurs communes du champ fermé. 31 px pour CAISSE/HÔTESSE correspond au
     cadran 2 validé ; STATISTIQUES dispose de 27 px utiles dans sa rangée 39 px.
     Toutes les valeurs restent définies ICI, pas dans les CSS métiers.
     -------------------------------------------------------------------------- */
  body.device-tablet #showCard,
  body.device-tablet.module-hostess #hostessShowCard {
    --tt-show-selector-h:31px;
  }
  body.device-tablet.module-statistics #statisticsPhoneSelectProxy {
    --tt-show-selector-h:27px;
  }

  body.device-tablet #app.ttModuleFrame #showCard > .caissePhoneShowProxy,
  body.device-tablet.module-hostess #hostessShowCard > .hostessPhoneShowProxy {
    grid-column:2 !important;
    align-self:center !important;
    justify-self:stretch !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 22px !important;
    align-items:center !important;
    gap:6px !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:var(--tt-show-selector-h) !important;
    min-height:var(--tt-show-selector-h) !important;
    max-height:var(--tt-show-selector-h) !important;
    margin:0 !important;
    padding:6px 10px !important;
    transform:translateY(-3px) !important;
    box-sizing:border-box !important;
    border:1px solid #3a4655 !important;
    border-radius:9px !important;
    background:#0f141b !important;
    color:#edf2f7 !important;
    font-family:Arial,Helvetica,sans-serif !important;
    font-size:clamp(10px,.95vw,14px) !important;
    font-weight:400 !important;
    font-style:normal !important;
    line-height:normal !important;
    letter-spacing:normal !important;
    cursor:pointer !important;
    overflow:hidden !important;
  }

  body.device-tablet #app.ttModuleFrame .caissePhoneSelectedShow,
  body.device-tablet.module-hostess .hostessPhoneShowProxy > #hostessPhoneSelectedShow {
    display:block !important;
    min-width:0 !important;
    max-width:100% !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  body.device-tablet #app.ttModuleFrame .caissePhoneSelectedShow > span {
    display:inline !important;
    white-space:nowrap !important;
  }
  body.device-tablet #app.ttModuleFrame .caissePhoneSelectedShow > span + span:not([hidden])::before {
    content:" — " !important;
  }
  body.device-tablet #app.ttModuleFrame .caissePhoneShowChevron,
  body.device-tablet.module-hostess .hostessPhoneShowChevron {
    justify-self:end !important;
    align-self:center !important;
    color:#c7d0da !important;
    font-size:15px !important;
    line-height:1 !important;
  }

  /* STATISTIQUES : même rendu commun, dans son proxy existant. */
  body.device-tablet.module-statistics #statisticsPhoneSelectProxy {
    position:relative !important;
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:var(--tt-show-selector-h) !important;
    min-height:var(--tt-show-selector-h) !important;
    max-height:var(--tt-show-selector-h) !important;
    margin:0 !important;
    box-sizing:border-box !important;
    cursor:pointer !important;
  }
  body.device-tablet.module-statistics #statisticsPhoneSelectProxy > .statisticsPhoneSelectedShow {
    display:flex !important;
    align-items:center !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-height:100% !important;
    margin:0 !important;
    padding:4px 34px 4px 10px !important;
    box-sizing:border-box !important;
    border:1px solid #3a4655 !important;
    border-radius:9px !important;
    background:#0f141b !important;
    color:#edf2f7 !important;
    font-family:Arial,Helvetica,sans-serif !important;
    font-size:clamp(10px,.95vw,14px) !important;
    font-weight:400 !important;
    font-style:normal !important;
    line-height:normal !important;
    letter-spacing:normal !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  body.device-tablet.module-statistics #statisticsPhoneSelectProxy::after {
    content:"⌄" !important;
    position:absolute !important;
    right:10px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    z-index:2 !important;
    pointer-events:none !important;
    color:#c7d0da !important;
    font-size:15px !important;
    line-height:1 !important;
  }

  /* --------------------------------------------------------------------------
     Popup commun CAISSE / HÔTESSE / STATISTIQUES.
     -------------------------------------------------------------------------- */
  body.device-tablet :is(.caissePhoneShowMenu,.hostessPhoneShowMenu,.statisticsPhoneShowMenu):not([hidden]) {
    position:fixed !important;
    inset:0 !important;
    z-index:2147483640 !important;
    display:block !important;
    background:transparent !important;
  }
  body.device-tablet :is(.caissePhoneShowMenuPanel,.hostessPhoneShowMenuPanel,.statisticsPhoneShowMenuPanel) {
    position:fixed !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    box-sizing:border-box !important;
    border:1px solid #475569 !important;
    border-radius:10px !important;
    background:#0f141b !important;
    box-shadow:0 14px 38px rgba(0,0,0,.42) !important;
  }
  body.device-tablet :is(.caissePhoneShowMenuRows,.hostessPhoneShowMenuRows,.statisticsPhoneShowMenuRows) {
    display:flex !important;
    flex-direction:column !important;
    width:100% !important;
    min-width:0 !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption) {
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    min-height:38px !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 22px !important;
    align-items:center !important;
    gap:7px !important;
    margin:0 !important;
    padding:7px 12px !important;
    border:0 !important;
    border-bottom:1px solid rgba(255,255,255,.09) !important;
    border-radius:0 !important;
    color:#f7fafc !important;
    text-align:left !important;
    font:inherit !important;
    font-size:13px !important;
    line-height:1.15 !important;
    cursor:pointer !important;
  }

  /* Couleurs temporelles plus prononcées. */
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-past {
    background:rgba(220,38,38,.42) !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-current {
    background:rgba(34,197,94,.40) !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-future {
    background:rgba(59,130,246,.38) !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption):hover,
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).selected {
    filter:brightness(1.18) !important;
  }
  body.device-tablet :is(.caissePhoneShowOptionDot,.hostessPhoneShowOptionDot,.statisticsPhoneShowOptionDot) {
    width:15px !important;
    height:15px !important;
    border:2px solid rgba(255,255,255,.72) !important;
    border-radius:50% !important;
    box-sizing:border-box !important;
    justify-self:end !important;
    position:relative !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).selected
  :is(.caissePhoneShowOptionDot,.hostessPhoneShowOptionDot,.statisticsPhoneShowOptionDot) {
    border-color:#6ea8ff !important;
  }
  body.device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).selected
  :is(.caissePhoneShowOptionDot,.hostessPhoneShowOptionDot,.statisticsPhoneShowOptionDot)::after {
    content:"" !important;
    position:absolute !important;
    inset:3px !important;
    border-radius:50% !important;
    background:#6ea8ff !important;
  }

  /* Thème clair : même géométrie, palette adaptée. */
  body[data-theme="light"].device-tablet #app.ttModuleFrame #showCard > .caissePhoneShowProxy,
  body[data-theme="light"].device-tablet.module-hostess #hostessShowCard > .hostessPhoneShowProxy,
  body[data-theme="light"].device-tablet.module-statistics #statisticsPhoneSelectProxy > .statisticsPhoneSelectedShow {
    background:#fff !important;
    color:#1f2937 !important;
    border-color:#b9c2cc !important;
  }
  body[data-theme="light"].device-tablet :is(.caissePhoneShowMenuPanel,.hostessPhoneShowMenuPanel,.statisticsPhoneShowMenuPanel) {
    background:#fff !important;
    border-color:#b9c2cc !important;
  }
  body[data-theme="light"].device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption) {
    color:#1f2937 !important;
    border-bottom-color:rgba(15,23,42,.08) !important;
  }
  body[data-theme="light"].device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-past {
    background:#ffc4c9 !important;
  }
  body[data-theme="light"].device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-current {
    background:#c8f3d5 !important;
  }
  body[data-theme="light"].device-tablet :is(.caissePhoneShowOption,.hostessPhoneShowOption,.statisticsPhoneShowOption).ttShowPeriod-future {
    background:#cbdfff !important;
  }
}

/* GESTION > LES SHOWS : couleurs centralisées dans la même autorité commune. */
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-past {
  background:rgba(220,38,38,.42) !important;
}
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-current {
  background:rgba(34,197,94,.40) !important;
}
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-future {
  background:rgba(59,130,246,.38) !important;
}
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-past:hover,
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-past.active {
  background:rgba(220,38,38,.56) !important;
}
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-current:hover,
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-current.active {
  background:rgba(34,197,94,.54) !important;
}
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-future:hover,
body.module-gestion .gestionShowsSearchOption.ttShowPeriod-future.active {
  background:rgba(59,130,246,.52) !important;
}
