/* GestiConnect V91-61 — responsive admin/mobile shell and common component hardening. */
.mobile-nav-toggle,
.mobile-nav-backdrop,
.pa-mobile-backdrop{display:none}

/* Prevent isolated widgets from forcing the whole page wider than the viewport. */
.main,.content,.card,.card-body,.page-head,.page-subhead,.topbar,.topbar-title-group,.topbar-actions{min-width:0}
img,svg,canvas,video{max-width:100%}
.table-wrap,.gc-mobile-table-wrap,.pa-table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
.gc-mobile-table-wrap{position:relative;border-radius:inherit}

@media (max-width: 820px){
  html{overflow-x:hidden}
  body{overflow-x:hidden}
  body.mobile-nav-open{overflow:hidden;touch-action:none}

  .app-shell{display:block;min-height:100dvh}
  .main{width:100%;min-width:0}

  /* Main tenant navigation becomes a real mobile drawer instead of a long block above the page. */
  .sidebar{
    position:fixed!important;
    inset:0 auto 0 0;
    width:min(88vw,320px);
    height:100dvh!important;
    z-index:1400;
    padding:18px 12px 14px!important;
    transform:translateX(-105%);
    transition:transform .22s ease;
    box-shadow:20px 0 55px rgba(0,0,0,.28);
    overflow:hidden!important;
  }
  .sidebar.is-mobile-open{transform:translateX(0)}
  .sidebar .brand{margin-bottom:18px;font-size:19px}
  .sidebar .brand-mark{width:34px;height:34px}
  .sidebar .org-name{margin:-10px 5px 14px}
  .sidebar .nav{overflow-y:auto;overflow-x:hidden;padding-right:2px;padding-bottom:16px;-webkit-overflow-scrolling:touch}
  .sidebar .nav a{min-height:44px;padding:11px 12px;font-size:13px}
  .sidebar .nav-section summary{min-height:46px}
  .sidebar-footer{position:static!important;margin-top:10px!important;padding-top:10px!important}

  .mobile-nav-backdrop{
    position:fixed;inset:0;z-index:1350;background:rgba(9,23,18,.48);backdrop-filter:blur(2px)
  }
  body.mobile-nav-open .mobile-nav-backdrop{display:block}

  .topbar{
    position:sticky!important;
    top:0;
    z-index:1200;
    min-height:60px;
    padding:9px 10px!important;
    gap:8px;
    background:rgba(255,255,255,.97);
    backdrop-filter:blur(12px);
  }
  .topbar-title-group{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
  .topbar h1{font-size:17px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-nav-toggle{
    display:inline-grid;place-items:center;flex:0 0 42px;width:42px;height:42px;
    border:1px solid #cbd6e2;border-radius:11px;background:#fff;color:var(--navy);
    font-size:21px;font-weight:900;cursor:pointer
  }
  .topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:0 0 auto}
  .topbar-actions .user-chip{display:none}
  .topbar-actions .btn,.topbar-actions .alert-chip{min-height:40px;padding:8px 10px;font-size:11px;white-space:nowrap}
  .org-switcher select{min-width:0!important;width:min(38vw,180px);height:40px;padding:7px 9px;font-size:12px}

  .content{width:100%;padding:14px 10px 38px!important;overflow-x:hidden}
  .footer-note{margin-top:18px;text-align:center}

  /* Touch targets and iOS-friendly fields. */
  .btn{min-height:44px;padding:10px 13px}
  .btn-sm{min-height:40px;padding:8px 10px}
  input,select,textarea{min-height:44px;font-size:16px}
  input[type="checkbox"],input[type="radio"]{min-height:0;width:auto;min-width:20px;height:20px}
  textarea{min-height:110px}

  .page-head,.page-subhead{align-items:stretch!important;flex-direction:column!important;gap:10px!important;margin-bottom:14px}
  .page-head h2{font-size:21px}
  .page-head .actions,.page-head .header-actions,.page-subhead .actions,.header-actions{width:100%}
  .actions,.header-actions{gap:7px}
  .actions>.btn,.header-actions>.btn{flex:1 1 auto}

  .card{border-radius:12px;box-shadow:0 5px 16px rgba(28,50,75,.045)}
  .card-header{padding:14px;align-items:flex-start;flex-wrap:wrap}
  .card-header h2,.card-header h3{font-size:15px}
  .card-body{padding:14px}
  .stat{padding:15px}
  .stat-value{font-size:24px}

  .grid,.grid-2,.grid-3,.grid-4,.grid-6,.form-grid,.form-grid-3{gap:12px}
  .grid-2,.grid-3,.grid-4,.grid-6,.form-grid,.form-grid-3{grid-template-columns:1fr!important}
  .form-group.full{grid-column:auto}

  /* Wide business tables stay usable with a deliberate horizontal swipe area. */
  .table-wrap,.gc-mobile-table-wrap{margin-inline:0;padding-bottom:3px;scrollbar-width:thin}
  .table-wrap table,.gc-mobile-table-wrap table{min-width:680px}
  th,td{padding:10px 11px;font-size:12px}
  th{font-size:10px}

  .searchbar{width:100%;max-width:none;display:grid;grid-template-columns:1fr;gap:7px}
  .searchbar input{min-width:0}
  .inline-form,.planning-filter-actions,.profit-tabs{gap:7px}

  .trade-banner{align-items:flex-start;flex-direction:column;padding:15px}
  .trade-banner .actions{width:100%}
  .check-grid{grid-template-columns:1fr!important}
  .payment-item{grid-template-columns:1fr;gap:6px}
  .summary-box{width:100%;max-width:none;margin-left:0}

  /* Modals use the full screen on phones and keep actions reachable. */
  .modal-overlay{padding:0!important;align-items:stretch!important}
  .modal-dialog,.intervention-modal-dialog,.document-creation-dialog{
    width:100vw!important;max-width:none!important;height:100dvh;max-height:100dvh!important;border-radius:0!important
  }
  .modal-header{padding:12px 13px;align-items:flex-start}
  .modal-header h2{font-size:18px}
  .modal-close{width:42px;height:42px;flex:0 0 42px}
  .modal-body{padding:10px!important}
  .modal-footer{position:sticky;bottom:0;z-index:3;padding:10px;gap:8px;background:#fff;box-shadow:0 -8px 18px rgba(20,40,30,.06)}
  .modal-footer .btn{flex:1}
  .document-creation-frame{min-height:0;height:100%}

  /* Common horizontally dense controls. */
  .planning-filter-form{grid-template-columns:1fr!important}
  .week-planning-grid{grid-template-columns:repeat(7,minmax(150px,1fr))}
  .hour-row{grid-template-columns:58px 1fr}
  .hour-label{padding:10px 7px;font-size:11px}
  .hour-content .calendar-event{min-width:210px}
  .kanban-board{grid-template-columns:repeat(4,minmax(220px,1fr))}
}

@media (max-width: 520px){
  .topbar-actions .btn.btn-secondary{display:none}
  .topbar-actions .alert-chip{font-size:0;width:40px;padding:0}
  .topbar-actions .alert-chip::after{content:"!";font-size:15px;font-weight:900}
  .org-switcher select{width:34vw;max-width:145px}
  .content{padding-inline:8px!important}
  .card-header,.card-body{padding:12px}
  .page-head h2{font-size:19px}
  .actions>.btn,.header-actions>.btn{flex:1 1 100%}
  .modal-footer{flex-wrap:wrap}
  .modal-footer .btn{flex:1 1 calc(50% - 8px)}
}

/* Platform/SaaS admin: reinforce the existing mobile drawer and dense screens. */
@media (max-width:780px){
  .platform-body.pa-nav-open{overflow:hidden}
  .pa-mobile-backdrop{position:fixed;inset:0;z-index:19;background:rgba(8,24,40,.46);backdrop-filter:blur(2px)}
  .platform-body.pa-nav-open .pa-mobile-backdrop{display:block}
  .pa-sidebar{z-index:30!important;width:min(88vw,320px)!important}
  .pa-mobile-toggle{min-width:42px;min-height:42px;align-items:center;justify-content:center}
  .pa-topbar{position:sticky!important;top:0;z-index:18;padding:9px 10px!important;align-items:center!important}
  .pa-title-wrap{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;min-width:0}
  .pa-title-wrap h1{font-size:17px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pa-title-wrap p{grid-column:1/-1;margin-top:0}
  .pa-top-actions{gap:6px;flex-wrap:nowrap;overflow-x:auto;max-width:48vw;padding-bottom:2px}
  .pa-top-actions .pa-btn{flex:0 0 auto}
  .pa-content{padding:14px 9px 40px!important;overflow-x:hidden}
  .pa-card-head,.pa-card-body{padding:13px!important}
  .pa-btn{min-height:44px}
  .pa-btn-sm{min-height:38px}
  .pa-field input,.pa-field select,.pa-field textarea{min-height:44px;font-size:16px}
  .pa-table-wrap,.gc-mobile-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .pa-table{min-width:720px}
  .pa-actions{gap:6px}
  .pa-page-head{gap:10px;margin-bottom:13px}
  .pa-page-head .pa-actions{width:100%}
  .pa-page-head .pa-actions .pa-btn{flex:1}
}

@media(max-width:520px){
  .pa-top-actions{display:none}
  .pa-title-wrap{width:100%}
  .pa-title-wrap p{display:none!important}
  .pa-page-head h2{font-size:20px}
  .pa-actions .pa-btn{flex:1 1 100%}
}

/* V91-70 - Navigation ventes & tableau de bord commercial */
.nav-subgroup-label{margin:12px 16px 4px;padding-top:8px;border-top:1px solid rgba(255,255,255,.12);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.58)}
.nav-subgroup-label:first-of-type{margin-top:6px}
.sales70-head{align-items:flex-end}
.sales70-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:14px}
.sales70-chart-card{padding:22px;min-width:0}
.sales70-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px}.sales70-card-head h3{margin:4px 0 2px;font-size:29px;line-height:1.1;color:#17352d}.sales70-card-head p{margin:0;color:#6b7b76}.sales70-eyebrow{font-size:11px;font-weight:900;letter-spacing:.09em;color:#667085}
.sales70-bars{display:grid;gap:19px}.sales70-bar-row{display:grid;gap:7px}.sales70-bar-label{display:flex;align-items:center;justify-content:space-between;gap:14px}.sales70-bar-label span{font-weight:700;color:#334155}.sales70-bar-label strong{font-size:14px;color:#0f172a}.sales70-bar-row small{color:#73817d}.sales70-bar-track{height:18px;border-radius:999px;background:#edf1f4;overflow:hidden}.sales70-bar-track>span{display:block;height:100%;min-width:0;border-radius:inherit}.sales70-bar-track .is-accepted{background:#7aa997}.sales70-bar-track .is-signed{background:#174936}
.sales70-invoice-chart{display:flex;width:100%;height:30px;border-radius:999px;overflow:hidden;background:#edf1f4;margin:22px 0}.sales70-invoice-chart>span{height:100%}.sales70-invoice-chart .is-paid{background:#174936}.sales70-invoice-chart .is-due{background:#e6ad47}.sales70-invoice-chart .is-empty{background:#e8edf0}
.sales70-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.sales70-legend>div{position:relative;padding:14px 14px 14px 38px;border:1px solid #dde5e9;border-radius:12px;background:#fbfcfd;display:grid;gap:2px}.sales70-legend i{position:absolute;left:14px;top:18px;width:12px;height:12px;border-radius:3px}.sales70-legend i.is-paid{background:#174936}.sales70-legend i.is-due{background:#e6ad47}.sales70-legend span{font-size:12px;color:#667085}.sales70-legend strong{font-size:18px;color:#172b25}.sales70-legend small{color:#798681}
.sales70-mini-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:20px;padding-top:18px;border-top:1px solid #e2e8ec}.sales70-mini-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sales70-mini-grid div{padding:10px 12px;border-radius:10px;background:#f7f9fa}.sales70-mini-grid span{display:block;font-size:11px;color:#71807b}.sales70-mini-grid strong{display:block;margin-top:3px;color:#17352d}
.sales70-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:18px}.sales70-summary-card{text-decoration:none;color:inherit;padding:18px;display:grid;gap:4px}.sales70-summary-card>span{font-size:12px;font-weight:800;color:#667085;text-transform:uppercase;letter-spacing:.04em}.sales70-summary-card>strong{font-size:25px;color:#17352d}.sales70-summary-card>small{color:#71807b}.sales70-summary-card:hover{border-color:#8fb9aa;box-shadow:0 8px 24px rgba(23,73,54,.08)}
.sales70-shortcuts{margin-top:18px}.sales70-shortcut-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 20px 20px}.sales70-shortcut-grid a{display:grid;gap:4px;padding:15px;border:1px solid #dce5e8;border-radius:12px;text-decoration:none;background:#fbfcfd;color:#1c312a}.sales70-shortcut-grid a:hover{border-color:#8fb9aa;background:#f4faf7}.sales70-shortcut-grid strong{font-size:14px}.sales70-shortcut-grid small{color:#72807c}
@media(max-width:1000px){.sales70-grid{grid-template-columns:1fr}.sales70-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.sales70-chart-card{padding:16px}.sales70-card-head{flex-direction:column}.sales70-legend,.sales70-mini-grid,.sales70-mini-grid-2,.sales70-summary-grid,.sales70-shortcut-grid{grid-template-columns:1fr}.sales70-shortcut-grid{padding:0 14px 14px}.sales70-card-head h3{font-size:24px}}
