/* HUGIN · adaptation téléphone et tablette.
   Feuille partagée par toutes les pages, chargée après leur style propre.
   Rien ne change au-dessus de 760 px de large : l'écran d'ordinateur reste tel quel.
   Les variables de couleur diffèrent entre les pages récentes (--card) et les deux
   anciennes, Base et Statistiques (--surface) : d'où les var() avec repli. */

/* ---------- valable partout : lien téléphone et navigation ---------- */
.nav{-ms-overflow-style:none;scrollbar-width:none}
.nav::-webkit-scrollbar{display:none}
a.num{text-decoration:none}
.tel-btn{display:none}

@media (max-width:760px){

  /* ----- squelette ----- */
  body{padding:14px 14px 40px !important}
  .shell{max-width:100%}
  .carte,.card{padding:16px 16px !important;border-radius:16px}
  .carte+.carte{margin-top:12px}
  h2{font-size:15px}

  /* iOS zoome sur tout champ dont la police fait moins de 16 px */
  input,select,textarea{font-size:16px !important}
  input[type=date],input[type=datetime-local],input[type=number]{min-width:0}

  /* ----- en-tête : marque, compteurs, navigation qui défile ----- */
  .top,header{gap:12px !important;margin-bottom:14px !important;align-items:flex-start}
  .top>.marque{width:100%}
  .top>.jour{width:100%;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;
    background:var(--card);border-radius:14px;padding:10px 6px}
  .top>.jour .j b{font-size:20px}
  .top>.jour .j span{font-size:9.5px;letter-spacing:.06em}
  .nav{width:100%;display:flex;flex-wrap:nowrap !important;overflow-x:auto;
    -webkit-overflow-scrolling:touch;gap:6px !important;padding:2px 0 6px;
    margin:0 -14px;padding-left:14px;padding-right:14px;width:calc(100% + 28px)}
  .nav a,.nav a.lnk{flex:0 0 auto;background:var(--card,var(--surface));border:1px solid var(--line);
    border-radius:20px;padding:8px 13px;font-size:13.5px;margin:0 !important;white-space:nowrap;
    color:var(--ink2,var(--ink));line-height:1}
  .nav a.actif{background:var(--or,var(--accent));border-color:var(--or,var(--accent));color:#221d10}
  .nav a.bloque{opacity:.45}
  .nav #moi{flex:0 0 auto;white-space:nowrap;padding:8px 4px;font-size:12.5px}
  .nav select{flex:0 0 auto;font-size:14px !important;padding:7px 10px}

  /* fenêtres modales : plein écran presque, boutons empilés */
  .ov,.overlay{padding:10px !important;align-items:flex-end !important}
  .fen,.modal,.boite{padding:20px 18px !important;max-height:92vh !important;border-radius:18px !important;max-width:100% !important}
  .pieds,.foot{flex-wrap:wrap}
  .pieds .btn,.pieds .b,.foot .btn{flex:1 1 auto;text-align:center}
  .row2,.r2,.r3{grid-template-columns:1fr !important}
  .msg{max-width:calc(100% - 28px);width:max-content;left:14px;right:14px;transform:none;
    margin:0 auto;text-align:center}

  /* ----- Ma liste ----- */
  .filtres{gap:8px}
  .filtres .cherche{flex:1 1 100%;min-width:0}
  .filtres #ville{width:100% !important;flex:1 1 100%}
  .filtres .onglets{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap}
  .filtres .onglets button{flex:1 1 auto;padding:9px 10px;font-size:13px}
  .filtres>.appeler{width:100%;text-align:center;padding:12px}
  ul.fiches li{grid-template-columns:1fr auto;gap:8px 12px;padding:14px 0}
  ul.fiches li .nm{font-size:16.5px}
  ul.fiches li .badges{grid-column:1/-1;justify-content:flex-start}
  ul.fiches li .appeler{padding:10px 14px;align-self:start}
  .pages button{padding:10px 14px}

  /* ----- Écran d'appel ----- */
  #fiche .qui{font-size:24px}
  .numzone .num{font-size:30px}
  .numzone{gap:10px;margin:14px 0 18px}
  .tel-btn{display:inline-flex;align-items:center;gap:8px;background:var(--vert);color:#04220f !important;
    border-color:var(--vert);font-size:15px;padding:12px 18px;flex:1 1 100%;justify-content:center;
    text-decoration:none;border-radius:13px}
  .pourquoi{padding:14px 16px}
  .pourquoi p{font-size:16.5px}
  .texte{font-size:16.5px}
  .obj{font-size:14.5px}
  /* les quatre boutons restent sous le pouce, quelle que soit la longueur du script */
  .carte.act{position:fixed;left:0;right:0;bottom:0;z-index:30;border-radius:18px 18px 0 0;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    box-shadow:0 -12px 30px rgba(0,0,0,.45);border-top:1px solid var(--line);
    display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .carte.act .lbl{display:none}
  .carte.act .gros{padding:13px 12px;font-size:14.5px;border-radius:13px;text-align:center}
  .carte.act .gros small{display:none}
  .carte.act .suite{grid-column:1/-1;margin:0;justify-content:space-around}
  .carte.act .lien{font-size:13px;padding:6px}
  /* la place que prend la barre fixe, pour que la fin du script reste lisible */
  body.page-appel{padding-bottom:210px !important}
  body.page-appel #msg{bottom:auto;top:14px}
  .suivants li b{max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* ----- Base (index) ----- */
  header .brand img{width:38px}
  header .wordmark{font-size:22px}
  header .right{width:100%;flex-wrap:wrap;gap:10px !important}
  header .stats{width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:6px;
    background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px 6px}
  header .stat .n{font-size:20px}
  header .stat .l{font-size:9.5px}
  header .gear{width:40px;height:40px}
  .toolbar{flex-wrap:wrap;gap:10px}
  .toolbar h2{width:100%}
  .toolbar>div{display:grid !important;grid-template-columns:1fr 1fr;gap:8px !important;width:100%}
  .toolbar .btn{justify-content:center;padding:11px 10px;font-size:13.5px;white-space:nowrap}
  .toolbar .btn.gold{grid-column:1/-1}
  .jbarres{gap:4px}
  .jbarres .jour .pile{height:64px}
  /* le tableau devient une pile de fiches */
  .card table.base,.card table.base tbody,.card table.base tr,.card table.base td{display:block;width:100%}
  .card table.base thead{display:none}
  .card table.base tr{padding:12px 14px 10px;border-bottom:1px solid var(--line);position:relative}
  .card table.base tr:hover td{background:transparent}
  .card table.base td{padding:2px 0;border:0;max-width:none !important;white-space:normal !important;
    overflow:visible !important;font-size:14px}
  .card table.base td.chk{position:absolute;right:12px;top:12px;width:auto;padding:0}
  .card table.base td.chk input{width:22px;height:22px}
  .card table.base td[data-l]::before{content:attr(data-l);display:inline-block;min-width:74px;
    color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;margin-right:6px}
  .card table.base td.nom{padding-right:34px;margin-bottom:4px}
  .card table.base td.nom .nm{font-size:16px}
  .card table.base td.actions{position:static !important;box-shadow:none !important;text-align:left !important;
    display:flex;flex-wrap:wrap;gap:6px;padding-top:10px;background:transparent !important}
  .card table.base td.actions .ico{width:42px;height:42px;font-size:18px;background:rgba(255,255,255,.05);
    display:inline-flex;align-items:center;justify-content:center;border-radius:10px}
  .card table.base td.empty{padding:30px 10px;text-align:center}
  #pager{flex-wrap:wrap;gap:10px}
  #pager>span:last-child{justify-content:flex-start !important}
  #run-banner{flex-wrap:wrap}
  #run-banner-txt{white-space:normal !important}

  /* ----- Affaires : rendez-vous et ventes en fiches ----- */
  .onglets{overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap !important}
  .onglets button{flex:0 0 auto;padding:9px 12px}
  .tabwrap table.fiches,.tabwrap table.fiches tbody,.tabwrap table.fiches tr,.tabwrap table.fiches td{display:block;width:100%}
  .tabwrap table.fiches thead{display:none}
  .tabwrap table.fiches tr{padding:12px 0;border-bottom:1px solid var(--line)}
  .tabwrap table.fiches tr:last-child{border-bottom:0}
  .tabwrap table.fiches td{padding:3px 0;border:0;text-align:left !important;white-space:normal}
  .tabwrap table.fiches td[data-l]::before{content:attr(data-l);display:inline-block;min-width:88px;
    color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;margin-right:6px}
  .tabwrap table.fiches td.titre-fiche{font-size:16px;margin-bottom:4px}
  .tabwrap table.fiches .actes{justify-content:flex-start;padding-top:8px}
  .tabwrap table.fiches .actes .b{padding:10px 13px;font-size:13.5px}
  .bilan{grid-template-columns:1fr 1fr;gap:10px}
  .bi{padding:12px 14px}
  .bi b{font-size:20px}

  /* ----- Mes chiffres / Statistiques : tableaux de chiffres qui défilent, première colonne fixe ----- */
  .periode{gap:6px}
  .periode button{flex:1 1 auto;padding:10px 8px;font-size:13px}
  .periode input[type=date]{flex:1 1 40%}
  .gain .val{font-size:28px}
  .palier .taux{font-size:26px}
  .chiffres{grid-template-columns:1fr 1fr;gap:10px}
  .ch{padding:12px 14px}
  .ch b{font-size:21px}
  .tabwrap{margin-left:-16px;margin-right:-16px;padding:0 16px}
  .tabwrap table.defile th:first-child,.tabwrap table.defile td:first-child{position:sticky;left:0;
    background:var(--card,var(--surface));z-index:1;box-shadow:6px 0 10px -8px rgba(0,0,0,.7)}
  .tabwrap table.defile td,.tabwrap table.defile th{padding:10px 9px;font-size:13.5px}

  /* Statistiques (ancienne charte) */
  header .right select,header .right input{flex:1 1 45%;min-width:0}
  header .right #pro{flex:1 1 100%}
  .grid{grid-template-columns:1fr !important}
  .grid>*,.deux>div,.card{min-width:0}
  .cards{grid-template-columns:1fr 1fr;gap:8px}
  .kpi .n{font-size:22px}
  .funnel .lab{width:110px;font-size:12px}
  .funnel .v{width:44px;font-size:14px}
  .podium{grid-template-columns:1fr;gap:8px}
  .card .tabwrap{margin:0;padding:0;overflow-x:auto;max-width:100%}
  .card .tabwrap th,.card .tabwrap td{white-space:nowrap}

  /* ----- Contrats ----- */
  .avert{padding:12px 14px;font-size:13px}
  .liste li{flex-wrap:wrap}
  .liste li>span:last-child{flex-wrap:wrap;gap:6px !important}
  .liste li .btn{padding:8px 10px !important}
  .deux table{table-layout:fixed}
  #bareme td{padding:6px 3px}
  #bareme td input{padding:8px 6px;font-size:14px !important}
  #bareme th{padding:6px 3px;font-size:10px}
  .tabwrap table.defile{min-width:560px}

  /* ----- Suggestions ----- */
  .outils{gap:8px}
  .outils select{font-size:14px !important;flex:1 1 100%;width:100%}
  .outils .b{flex:1 1 auto}
}

/* Tablette : l'écran d'appel garde ses deux colonnes jusqu'à 1000 px, c'est le
   comportement d'origine. Rien à ajouter ici. */
