/* PALMROC OS — ajustements de l’application réelle (les styles de base viennent des maquettes). */
html, body, #root { height: 100%; margin: 0; }
body { background: var(--canvas); overflow: hidden; }
.app { height: 100vh; }
.content { overflow: auto; }
.sb .nav { overflow: auto; }
.sb .nl, .sb .ng-h, .sb-brand, .alma-card, .prof, .tb .gsearch, .tb .tb-ico, .tb .btn.pri, .tb-r > span:last-child { cursor: pointer; }
.sb .nl:hover { background: rgba(241, 94, 117, .07); }
.sb .nl.mock span:first-of-type::after { content: ''; }
button.btn { font-family: inherit; cursor: pointer; }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[data-act], .tab[data-tab], .stg[data-stage], .seg > span[data-view], .kbi[data-href], tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: #F9FAFB; }
.seg > span[data-view] { user-select: none; }
input.inp, select.inp, textarea.inp { width: 100%; box-sizing: border-box; font-family: inherit; outline: none; }
select.inp { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2377818A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; padding-right: 30px; }
textarea.inp { height: auto; min-height: 84px; padding: 9px 11px; line-height: 1.5; resize: vertical; white-space: pre-wrap; }
.inp:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(241, 94, 117, .14); }
.search input { border: 0; outline: none; font: inherit; color: var(--ink); flex: 1; min-width: 0; background: transparent; }
.drw-b { overflow: auto; }
.drw .x .btn, .mdl .btn { cursor: pointer; }
.veil, .drw, .mdl, .menu, .toast { position: fixed; }
.mdl { max-width: calc(100vw - 32px); }
.live-banner { margin-bottom: 16px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { color: var(--ink); display: block; font-size: 14px; margin-bottom: 6px; }
.err-text { color: var(--red); font-size: 12px; margin-top: 8px; }
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #F7F8F9, #EEF1F3); }
.login .card { width: 400px; max-width: calc(100vw - 32px); }
.spin-c { display: inline-block; width: 16px; height: 16px; border: 2px solid #E1E5E8; border-top-color: var(--pink); border-radius: 50%; animation: pspin .7s linear infinite; vertical-align: middle; }
@keyframes pspin { to { transform: rotate(360deg); } }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.mock-wrap { pointer-events: none; }
.note-txt { white-space: pre-wrap; }
@media (max-width: 1180px) { .sb { width: 220px; flex-basis: 220px; } .fiche-grid { grid-template-columns: 1fr !important; } }

/* Impression d’un document (bon de matériel, autorisation de captation) : seule la zone .print-area sort. */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .print-area .btn, .print-area .acts .btn { display: none !important; }
}

/* Tableau de bord : cartes de même taille (une hauteur unique, contenu défilant si besoin). */
.dash-grid{align-items:stretch}
.dash-grid>.card{display:flex;flex-direction:column;max-height:320px;min-width:0}
.dash-grid>.card>.card-h{flex:none}
.dash-grid>.card>.card-b{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#D7DDE1 transparent}
.dash-top{align-items:stretch}.dash-top>.card{height:100%;min-height:96px}
.dash-kpis>.card{height:100%;min-height:118px}
@media (max-width:900px){.dash-grid,.dash-top{grid-template-columns:1fr}}
/* Tableau de bord responsive : le texte passe à la ligne au lieu d'être coupé ; une seule colonne sur écran étroit. */
.dash-grid>.card>.card-b{overflow-x:hidden}
.dash-grid .tbl{width:100%;table-layout:fixed}
.dash-grid .tbl td{overflow-wrap:anywhere;word-break:normal;vertical-align:top}
.dash-grid .tbl td+td{white-space:normal!important;width:38%;text-align:right}
.dash-grid .card-h{flex-wrap:wrap;gap:6px}
.dash-grid .card-h h3,.dash-kpis .card *{overflow-wrap:anywhere}
.dash-grid .row{flex-wrap:wrap;min-width:0}
@media (max-width:1180px){.dash-grid{grid-template-columns:1fr}}
@media (max-width:1000px){.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media (max-width:560px){.dash-kpis{grid-template-columns:1fr!important}.dash-top form{flex-wrap:wrap}.dash-top form .inp{min-width:0}}
/* Barre du haut responsive : on compacte au lieu de déborder. */
.tb{min-width:0}.tb .crumbs{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tb-r{min-width:0;flex-shrink:1}
@media (max-width:1280px){.tb .gsearch{width:190px}}
@media (max-width:1120px){.tb .gsearch{width:36px;padding:0;justify-content:center}.tb .gsearch>span,.tb .gsearch kbd{display:none}.tb .sync{font-size:0;gap:0}.tb .sync svg{width:15px;height:15px}}
@media (max-width:900px){.tb .btn.pri{font-size:0;gap:0;padding:0 10px}.tb .btn.pri svg{width:16px;height:16px}.tb .alma-btn{font-size:0;gap:0}.tb .alma-btn svg{width:16px;height:16px}.tb{padding:0 14px;gap:8px}.tb-r{gap:6px}}
.tb .gsearch>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.tb .gsearch kbd,.tb .sync,.tb .btn.pri{white-space:nowrap;flex-shrink:0}

/* ===== OS responsive : téléphone, tablette, PC, grand écran ===== */
.tb-menu{display:none;width:36px;height:36px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);place-items:center;cursor:pointer;flex:none}
.sb-veil{display:none}
img,svg,video,canvas{max-width:100%}
/* Tableaux larges : défilement horizontal dans leur cadre plutôt que coupure */
.tbl-wrap,.card-b{overflow-x:auto}
.phd{flex-wrap:wrap}.phd>div:first-child{min-width:0}.phd .acts{flex-wrap:wrap}
.toolbar{flex-wrap:wrap}
@media (max-width:1180px){
  .g3,.g4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:900px){
  .tb-menu{display:grid}
  .sb{position:fixed;left:0;top:0;bottom:0;z-index:80;transform:translateX(-105%);transition:transform .2s ease;box-shadow:18px 0 50px rgba(30,34,40,.16);height:100vh;overflow-y:auto}
  .app.nav-open .sb{transform:none}
  .app.nav-open .sb-veil{display:block;position:fixed;inset:0;z-index:79;background:rgba(30,34,40,.35)}
  .content{padding:18px 16px;overflow:visible}
  .main{min-width:0;width:100%}
  .g2{grid-template-columns:1fr!important}
  /* Grilles écrites dans les pages : une colonne, sauf les calendriers (défilement horizontal) */
  [style*="grid-template-columns"]:not([style*="repeat(7"]):not([style*="repeat(9"]):not([style*="52px repeat"]){grid-template-columns:minmax(0,1fr)!important}
  [style*="repeat(7"],[style*="52px repeat"],[style*="repeat(9"]{min-width:640px}
  .content :has(> [style*="repeat(7"]),.content :has(> [style*="52px repeat"]){overflow-x:auto}
  .drw{width:100%!important;max-width:100%!important;left:0;border-radius:0}
  .drw-h,.drw-b,.drw-f{padding-left:16px;padding-right:16px}.drw-b{overflow-y:auto}
  .drw-f{flex-wrap:wrap;border-radius:0}
  .menu{max-width:calc(100vw - 16px)}
  .tb .crumbs>span,.tb .crumbs .sl{display:none}
}
@media (max-width:560px){
  .g3,.g4{grid-template-columns:1fr!important}
  .phd h1{font-size:22px}
  .tb{padding:0 10px}.tb-r{gap:4px}.tb .tb-r>span:last-child svg{display:none}
  .tbl{font-size:12px}
}
/* Grand écran d'affichage : on garde des lignes lisibles */
@media (min-width:1900px){
  .content{padding:28px 40px}
  .dash-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Onglets et sélecteurs : défilent horizontalement si l'écran est étroit */
.tabs{overflow-x:auto;overflow-y:hidden;scrollbar-width:none;max-width:100%}.tabs::-webkit-scrollbar{display:none}
.tab{white-space:nowrap;flex:none}
.seg{max-width:100%;overflow-x:auto;scrollbar-width:none}.seg>*{white-space:nowrap;flex:none}
.content .card{min-width:0;max-width:100%}
@media (max-width:900px){.toolbar>*{max-width:100%}.content .row{flex-wrap:wrap}}
.content .f{flex-wrap:wrap;min-width:0}
.dash-grid .tbl td{white-space:normal}.dash-grid .tbl td:first-child{padding-right:10px}
