/* Outil Môdely — entrepreneuriat.mg
   Charte : bleu #0F3F6E / #1C6AB6, rouge d'action #D42A2E */
@font-face {
    font-family: roboto;
    src: url('../webfonts/Roboto-Light.ttf');
    font-weight: lighter;
}
:root{ --bleu:#0F3F6E; --bleu2:#1C6AB6; --rouge:#D42A2E; --rouge2:#A51E25; --encre:#14223A; --encre2:#4A5A73; --trait:#E4E8EF; }
b,strong{ font-weight: bold !important; }
body{ font-family:'Figtree',system-ui,sans-serif; color:var(--encre); background:#F3F6FA; margin:0; }
.skip{position:absolute;left:-999px;top:8px;background:var(--bleu);color:#fff;padding:10px 14px;border-radius:8px;z-index:99}
.skip:focus{left:12px}
:focus-visible{outline:3px solid #F94545;outline-offset:2px}
.m-in{ max-width:1470px; margin:0 auto; padding-left:16px; padding-right:16px; }

/* Barre du site */
.m-bar{ background:#fff; border-bottom:1px solid var(--trait); }
.m-bar .m-in{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding-top:8px; padding-bottom:8px; }
.m-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--encre); }
.m-brand b{ font-family:'Bricolage Grotesque',sans-serif; font-weight:800; font-size:18px; display:block; line-height:1.1; }
.m-brand small{ font-size:12px; color:var(--encre2); }
.m-back{ color:var(--encre2); text-decoration:none; font-weight:600; font-size:15px; padding:10px 6px; }
.m-back:hover{ color:var(--rouge); }
#languages{ margin-left:auto; }
.m-lang{ background:#fff; border:1.5px solid var(--trait); border-radius:999px; padding:8px 14px; font-weight:600; font-size:14.5px; color:var(--encre); min-height:44px; }
#languages .dropdown-item{ display:flex; justify-content:space-between; gap:12px; padding:8px 14px !important; font-size:15px; }
#languages li>button>span{ width:100%; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.flag{ font-size:0.8em; width:28px; }

/* Barre d'outils */
.m-tools{ background:#fff; border-bottom:1px solid var(--trait); padding:18px 0 14px; }
.m-row{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px 24px; }
.m-title h1{ font-family:'Bricolage Grotesque',sans-serif; font-weight:800; font-size:clamp(26px,3vw,34px); letter-spacing:-.02em; margin:0; color:var(--bleu); }
.m-sub{ margin:2px 0 0; color:var(--encre2); font-size:15.5px; }
.m-actions{ display:flex; flex-wrap:wrap; gap:8px; }
.m-btn{ display:inline-flex; align-items:center; gap:8px; font:inherit; font-weight:700; font-size:15px; padding:10px 16px; border-radius:999px; min-height:44px; cursor:pointer; text-decoration:none; border:1.5px solid transparent; margin:0; }
.m-btn-ligne{ background:#fff; color:var(--bleu); border-color:#C7D5E6; }
.m-btn-ligne:hover{ background:#EAF2FB; color:var(--bleu); }
.m-btn-rouge{ background:var(--rouge); color:#fff; }
.m-btn-rouge:hover{ background:var(--rouge2); color:#fff; }
#export_pdf .spinner-border{ width:18px !important; height:18px !important; border-width:2px; }

/* Formulaire Projet / Établi par / Version */
#form{ display:grid; grid-template-columns:2fr 2fr 1fr; gap:14px; margin-top:16px; }
#form .col{ position:relative; }
#form input{ font-weight:500; min-height:46px; border-color:#C7D5E6; }
#form input:focus{ box-shadow:0 0 0 .2rem rgba(28,106,182,.2); border-color:var(--bleu2); }
#form label{ position:absolute; top:-0.55rem; left:0.8rem; font-size:0.8rem; padding:0 6px; background:#fff; color:var(--encre2); font-weight:600; }
.m-hint{ display:none; margin:12px 16px 0; font-size:14px; color:var(--encre2); background:#EAF2FB; border-radius:12px; padding:10px 14px; }

/* Zone du tableau */
#wrapper{ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:20px 16px 8px; outline:none; }
#conteneur{ width:min(1470px, 100%); min-width:1100px; margin:0 auto; }
#chargement{ top:45%; left:0; width:100%; display:flex; justify-content:center; z-index:50; pointer-events:none; }
#tableaux{ background:#fff; }

/* Informations et pied de page */
#bottom-page{ padding-top:10px; padding-bottom:28px; }
#information{ display:flex; align-items:center; gap:14px; background:#fff; border:1px solid var(--trait); border-radius:14px; padding:14px 18px; font-size:15px; color:var(--encre2); }
#information .fas{ font-size:26px; flex:0 0 auto; color:#1C6AB6; }

#tableau{
    height: 500px;
    z-index: 2;
    position: relative;
}
.tableau2{
    height: 350px !important;
}
#tableaux{
    background-size: 100% 24px, 24px 100%;  
    position: relative;
    border: 1px solid #9DB3CC;
}
#tableaux #background{
    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(transparent 23px, rgba(185, 205, 228) 24px, transparent 24px), linear-gradient(90deg, transparent 23px, rgba(185, 205, 228) 24px, transparent 24px);
    background-size: 100% 24px, 24px 100%; 
    opacity: 0.5;/*Change this to 0.15 when exporting*/
}

#tableau #entete{
    background: #EAF2FB;
    color: #0F3F6E;
    border-bottom:1px solid #9DB3CC;
    border-top:1px solid #9DB3CC;
    text-align: center;
    padding: 0px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#tableau #entete .custom_font{
    font-size: 1.35em;
    width: 50px;
}
.flag{
    font-size: 0.8em;
    width: 50px;
}
.icon-user,.icon-factory,.icon-car{
    font-size: 1.6em !important;
}
#tableau #entete span:not(#add,.custom_font)
{
    padding: 0;
    width: 100%;
}
#tableau .col{
    border-left: 1px solid #9DB3CC;
    width: 100%;
    flex-direction: column;
    display: flex;
    height: 100%;
    /* overflow: hidden; */
}
#tableau .col #contenue{
    height: 100%;
    padding: 0px 10px;
    padding-bottom: 10px;
    flex-grow: 1;
    flex-basis: 0%;
    position: relative;
    /* overflow: hidden; */
}

#tableau .col #contenue:hover,.tableauConteneurhover{
    background: rgba(0, 0, 0, 0.037);
}
#add{
    padding: 5px;
    cursor: pointer;
}
#add:hover{
    color: #D42A2E;
}

/*drag and drop element*/
#ligne{
    background: #9b9b9b;
    width: 100%;
    height: 1px;
}

.sticker{
    /* disable box-shadow, when exporting pdf  */
    box-shadow: 0 3px 4px 0 rgba(0,0,0,.5);
    margin-top: 12px;
    /* position: relative; 
    width: 100%; */
    position: absolute;
    width: calc(100% - 20px);
    padding-top: 5px;
    cursor: grab;
    /* z-index: 2; */
}
/* Set display to block to change box-shadow to image png, when exporting pdf  */
.sticker div[id*='shadow']{
    display: none; 
}


.sticker #shadowB{
    background: url("../images/shadowBottom-repeat.png") repeat ;
    position: absolute;
    width: calc(100% - 27px);
    height: 9px;
    left: 20px;
    opacity: 0.5;
}
.sticker #shadowB:before{
    content: "";
    background: url("../images/shadowBottom-Lcorner.png") no-repeat ;
    position: absolute;
    width: 16px;
    height: 9px;
    left: -16px;
}
.sticker #shadowB::after{
    content: "";
    background: url("../images/shadowBottom-Rcorner.png") no-repeat ;
    position: absolute;
    width: 20px;
    height: 10px;
    right: -20px;
}
.sticker #shadowL{
    background: url("../images/shadowLeft-repeat.png");
    position: absolute;
    width: 8px;
    height: calc(100% - 20px);
    bottom: 0px;
    left: 100%;
    opacity: 0.5;
}
.sticker #shadowL::before{
    content: "";
    background: url("../images/shadowLeft-top.png") no-repeat;
    position: absolute;
    width: 8px;
    height: 16px;
    top: -16px;
    background-position: bottom;
}

.sticker #data{
    padding: 0px 8px 5px 8px;
    background:none;
}
.sticker #titre,.sticker #val{
    background: none;
    border: none;
    overflow: hidden;
    overflow-wrap: break-word;
    resize: none;
    min-height: 32px;
    line-height: 22px; 
    cursor: text;
    font-family: Roboto;
    display: block;
    padding-top: 4px;
    /* word-break: break-all; */
    /*hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;*/
    /* height: 21px; */
}
.sticker #val div{
    display: block;
}

.sticker #titre{
    font-size: 18px;
    font-weight: 500;
    margin-top: 3px;
    color: black;
}
.sticker #val{
    font-weight: lighter;
}
.sticker #titre:focus,.sticker #val:focus{
    background-color: rgba(255, 255, 255, 0.15);
    outline: 0;
}

.active_droppable{
    background: rgba(64, 90, 4, 0.212);
}
.hover_droppable{
    background: rgba(0, 0, 0, 0.212);
}
.drag-placeholder{
    border: 1px dashed grey;
    margin-top: 10px;
    height: 80px;
    width: 100%;
}
#export_pdf .spinner-border{
    width: 23px !important;
    height: 23px !important;
}
#export_pdf,#sauvegarde,#open{
    cursor: pointer;
}

#export_pdf .fas,#sauvegarde .fas{
    font-size: 20px;
}
/* #export_pdf,#sauvegarde{
    position: fixed;
    left: 10%;
    top: 10%;
} */


#information .fas:hover{
    color: #0F3F6E;
}

.spinner-border{
    width: 4rem !important;
    height: 4rem !important;
}

@keyframes rotate { 
    from { 
        transform: rotate(0deg); 
    } to { 
        transform: rotate(360deg); 
    }
}

.icon_reload{
    animation :rotate 2s linear infinite;
}
.sticker #val{
    font-size: 16px;
}

#dropIndicator{
    position: absolute;
    left: 4px;
    width: calc(100% - 8px);
    height: 50px;
    border: 1px dashed #838383;
    border-radius: 5px;
    z-index: 0;
    display: none;
}

.tooltip-inner {
    text-align: left; 
    max-width: 320px;
    font-size: 0.9em;
}





.m-foot{ background:#0A2E52; color:#C9D3E3; font-size:13.5px; padding:16px 0; }

/* Modale PDF */
#modal_export iframe{ width:100%; height:78vh; border:0; }
#chargement_export{ background:#fff; inset:0; z-index:2; }

/* Notes : poignée de déplacement visible */
.sticker #drop_btn{ height:12px !important; top:-1px !important; left:50%; transform:translateX(-50%); width:44px !important; }
.sticker #drop_btn span{ display:block; width:28px; height:4px; margin-top:4px; border-radius:4px; background:rgba(15,63,110,.25); }
@media (hover:none){
  .sticker #drop_btn{ height:22px !important; width:64px !important; top:-6px !important; }
  .sticker #drop_btn span{ width:40px; height:5px; margin-top:8px; background:rgba(15,63,110,.4); }
  #remove{ display:flex; }
}
#add{ background:none; border:0; color:inherit; font-size:1em; line-height:1; min-width:32px; min-height:32px; }

/* Petits écrans */
@media (max-width: 1000px){
  .m-hint{ display:block; }
}
@media (max-width: 700px){
  #form{ grid-template-columns:1fr; }
  .m-back{ order:3; width:100%; padding-top:0; }
  .m-actions .m-btn{ padding:10px 13px; font-size:14px; }
}

/* En-têtes de cases : hauteur identique partout (langues, canevas, écrans) */
:root{ --entete-h: 60px; }
#tableau #entete{
    box-sizing: border-box;
    height: var(--entete-h);
    min-height: var(--entete-h);
    max-height: var(--entete-h);
    flex: 0 0 var(--entete-h);
    overflow: hidden;
    padding: 0 6px;
    gap: 4px;
}
#tableau #entete .custom_font,
#tableau #entete .flag{ flex: 0 0 34px; width: 34px; text-align: center; }
#tableau #entete .tooltipTitle{
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 0;
    line-height: 1.15;
    font-size: 16px;
    overflow-wrap: normal;
    hyphens: none;
}
#tableau #entete #add{ flex: 0 0 30px; min-width: 30px; min-height: 30px; padding: 0; }
