/* assets/css/app.css — CLEAN */

:root{
  --bg:#0b0f17;
  --bg2:#070a10;

  --cardA: rgba(17,28,47,.72);
  --cardB: rgba(10,16,28,.72);

  --muted:#93a4b7;
  --text:#e8f0f8;
  --line: rgba(34,48,71,.78);

  --accent:#22c55e;
  --accent-soft: rgba(34,197,94,.14);

  --blue:#4da3ff;
  --blue-soft: rgba(77,163,255,.12);

  --danger:#ff4d4d;
  --danger-soft: rgba(255,77,77,.12);

  --shadow: 0 10px 30px rgba(0,0,0,.25);

  --sidebar-w: 280px;
  --radius: 14px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 30% 0%, #0f1b33 0%, rgba(15,27,51,0) 60%),
    linear-gradient(120deg,var(--bg2),var(--bg));
}

a{color:inherit;text-decoration:none}

/* utilities */
.hidden{display:none !important;}
.right{text-align:right}
.muted{color:var(--muted)}

/* ===== Layout ===== */
.layout{
  display:flex;
  min-height:100vh;
  width:100%;
}

/* sidebar in flow (desktop) */
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  padding:14px 12px 16px;
  background: linear-gradient(180deg, #020617, #0b1224);
  border-right:1px solid var(--line);
  position: sticky;
  top:0;
  height:100vh;
  overflow:auto;
  z-index:10;
}

.main-wrapper{flex:1;min-width:0;}

.main{
  padding:24px;
  min-width:0;
  max-width: 1400px;
}

/* ===== Sidebar UI ===== */
.sidebar-header { display:flex; flex-direction:column; gap:12px; }
.sidebar-header form { margin-top: 0; }
.brand { display:flex; flex-direction:column; align-items:flex-start }
.brand-logo img { height:auto; width:70%; display:block; border-radius:10px; margin-left:20px; }

/* le form + select prennent la largeur */
.client-switch { width:100%; }
.client-switch select { width:100%; }

.nav-sep{height:1px;background:var(--line);margin:12px 6px}

.sidebar-nav{display:flex;flex-direction:column;gap:6px;padding:0 4px}
.sidebar-nav .nav-item{width:100%}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  transition: background .15s ease, border-color .15s ease, transform .10s ease;
}

.nav-item .icon{width:22px;text-align:center;opacity:.95;flex:0 0 22px}
.nav-item .label{flex:1;font-weight:700}

.nav-item .badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  background: rgba(245,158,11,.16);
  border:1px solid rgba(245,158,11,.28);
  color:#ffd9a0;
}

.nav-item:hover{
  background: rgba(148,163,184,.14);
  border-color: rgba(148,163,184,.18);
  transform: translateX(2px);
}

.nav-item.active{
  background: var(--accent-soft);
  border-color: rgba(34,197,94,.22);
  box-shadow: inset 3px 0 0 rgba(34,197,94,.85);
}

.nav-item.danger:hover{
  background: rgba(255,77,77,.10);
  border-color: rgba(255,77,77,.22);
}

.sidebar-footer{
  margin-top:12px;
  padding:10px 10px 12px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}

/* ===== Cards / Typo ===== */
h1{margin:0 0 14px 0;font-size:34px;letter-spacing:.2px}
h2{margin:0 0 10px 0;font-size:16px;color:#d9e6f3}

.card{
  background: linear-gradient(180deg, var(--cardA), var(--cardB));
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
  margin-bottom:14px;
  box-shadow: var(--shadow);
}

/* header section with button to the right */
.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.section-body{margin-top:12px;}

.hint{color:var(--muted);font-size:12px;margin-top:10px}
.ok{background:var(--accent-soft);border:1px solid rgba(34,197,94,.28);padding:10px;border-radius:12px}
.error{background:var(--danger-soft);border:1px solid rgba(255,77,77,.28);padding:10px;border-radius:12px}

/* ===== Grid ===== */
.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid.three{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}

@media (max-width: 1100px){.grid.three{grid-template-columns:1fr}}
@media (max-width: 1000px){.grid.two{grid-template-columns:1fr}}

/* ===== Forms ===== */
.row{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
label{color:var(--muted);font-size:12px}

input,select,textarea{
  background:#0d1422;
  color:var(--text);
  border:1px solid rgba(34,48,71,.9);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}

input:focus,select:focus,textarea:focus{
  border-color: rgba(77,163,255,.55);
  box-shadow: 0 0 0 3px rgba(77,163,255,.12);
}

.actions{display:flex;gap:10px;align-items:center;margin-top:10px;flex-wrap:wrap}

.btn{
  background:rgba(255,255,255,.06);
  color:var(--text);
  border:1px solid rgba(34,48,71,.9);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover{border-color:rgba(77,163,255,.28);background:rgba(77,163,255,.08)}
.btn.primary{background:rgba(77,163,255,.18);border-color:rgba(77,163,255,.35)}
.btn.primary:hover{background:rgba(77,163,255,.26)}
.btn.danger{background:rgba(255,77,77,.12);border-color:rgba(255,77,77,.25)}
.btn.danger:hover{background:rgba(255,77,77,.18)}

/* ===== Tables ===== */
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px;border-bottom:1px solid rgba(34,48,71,.55);vertical-align:middle}
.table th{color:var(--muted);font-size:12px;text-align:left;background:rgba(13,20,34,.6)}
.table tr:hover td{background:rgba(77,163,255,.05)}

.toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.toolbar-right{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* pager */
.pager{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-top:12px;
}
.pbtn{
  min-width:36px;
  height:34px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(34,48,71,.9);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.pbtn:hover{background:rgba(77,163,255,.08);border-color:rgba(77,163,255,.22)}
.pbtn.active{background:rgba(77,163,255,.16);border-color:rgba(77,163,255,.30)}
.pbtn:disabled{opacity:.45;cursor:not-allowed}

/* ===== Tablet / Mobile (off-canvas sidebar) ===== */
@media (max-width: 960px){
  .layout{display:block}
  .sidebar{
    position: fixed;
    left:0; top:0;
    max-width: 250px;
    width: 250px;
    flex:none;
    transform: translateX(-100%);
    transition: transform .18s ease-out;
    z-index: 60;
  }
  .sidebar.open{ transform: translateX(0); }
  .main{ padding:14px; max-width:none; }
}




DIV.login-card { width: 350px; margin: 0 auto }






tr.low-stock td { background: rgba(255,77,77,.25) !important; }





.img-modal.hidden { display: none; }

.img-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.img-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.img-modal__content {
  position: relative;
  z-index: 2;
  max-width: min(92vw, 900px);
  max-height: 88vh;
  margin: 6vh auto 0;
  background: rgba(18,26,39,.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.img-modal__content img {
  width: 100%;
  height: auto;
  max-height: calc(88vh - 50px);
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.img-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.img-modal__close:hover {
  background: rgba(77,163,255,.08);
  border-color: rgba(77,163,255,.35);
}







.ps-head {
  display:flex; align-items:flex-start; gap:16px;
}
.ps-thumb {
  width:46px; height:46px; border-radius:10px;
  overflow:hidden; flex:0 0 auto;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  cursor: zoom-in;
}
.ps-title { font-weight:900; font-size:20px; line-height:1.15; }
.ps-sub { margin-top:4px; font-size:12px; opacity:.75; }

.ps-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.ps-chip { padding:6px 10px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); font-weight:700; font-size:12px; }

.ps-grid {
  display:grid;
  grid-template-columns: 1.1fr 1fr;
  gap:18px;
  margin-top:14px;
}
.ps-kv label { display:block; font-size:12px; opacity:.7; margin-bottom:6px; }
.ps-kv .val { font-weight:800; }

.ps-formgrid {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.ps-formgrid .full { grid-column: 1 / -1; }

.ps-actions {
  display:flex; gap:10px; justify-content:flex-end; align-items:center; margin-top:10px;
}
.ps-save-msg { margin-top:10px; }
.ps-save-msg .ok { color:#6fe58a; font-weight:800; }
.ps-save-msg .err { color:#ff6b6b; font-weight:800; }






tr.row-link { cursor: pointer; }
tr.row-link:hover { background: rgba(0,0,0,.05); }






/* Layout global */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 250px;              /* adapte */
  flex: 0 0 250px;
}

/* Contenu principal */
.app-main {
  flex: 1;
  min-width: 0;              /* 🔥 SUPER IMPORTANT */
  width: 100%;
}





/* Bouton burger (caché desktop) */
.app-burger{display:none;align-items:center;gap:8px;justify-content:center;height:42px;padding:0 14px;border-radius:12px;border:1px solid rgba(255,255,255,.10);background:linear-gradient(180deg,rgba(20,34,60,.85),rgba(10,18,32,.85));color:rgba(255,255,255,.92);box-shadow:0 8px 22px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.06);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);font-weight:700;font-size:12px;letter-spacing:.35px;text-transform:uppercase;cursor:pointer;user-select:none;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease,filter .12s ease}.app-burger:hover{border-color:rgba(120,190,255,.35);box-shadow:0 10px 28px rgba(0,0,0,.55),0 0 0 3px rgba(80,160,255,.12),inset 0 1px 0 rgba(255,255,255,.07)}.app-burger:active{transform:translateY(1px) scale(.99);filter:brightness(.95)}

/* Backdrop */
.app-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 999;
}

/* Mode tablette/mobile */
@media (max-width: 900px) {

  .app-burger {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform .18s ease;
    z-index: 1000;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-backdrop.is-open {
    display: block;
  }
}





.table-wrap {
  /* width: 100%; */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

/* Si tu veux éviter que le tableau se compacte trop */
.table-wrap table {
  /* width: 100%; */
  /* min-width: 900px; adapte selon tes pages */
  border-collapse: separate;
  border-spacing: 0;
}

/* Colonne actions sticky */
.table-wrap th.col-actions,
.table-wrap td.col-actions {
  position: sticky;
  right: 0;
  background: #fff; /* important sinon ça devient illisible */
  box-shadow: -10px 0 14px rgba(0,0,0,.06);
  z-index: 2;
}





@media (max-width: 900px) {
  .btn-text { display:none; }     /* si tu as icône + texte */
  .btn-icon { font-size: 18px; }  /* grossir icônes */
  .btn { padding: 10px 12px; }    /* zones cliquables */
}





tr.row-picked { background: rgba(16,185,129,.18); }
tr.row-done { opacity:.85; }

tr.row-ignored { opacity:.45; background: rgba(0,0,0,.04); }




.lg-tip-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lg-tip-btn{
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  color: #FFFFFF;
}

.lg-tip{
  display: none;
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;

  /* style dark cohérent avec ton app */
  background: linear-gradient(180deg, rgba(8,18,38,.98), rgba(6,12,24,.98));
  border: 1px solid rgba(110,170,255,.22);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03) inset;

  color: #eaf2ff;
  text-align: left;
  white-space: normal;
  backdrop-filter: blur(4px);
}

/* petite flèche */
.lg-tip::before{
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(8,18,38,.98);
  border-left: 1px solid rgba(110,170,255,.22);
  border-top: 1px solid rgba(110,170,255,.22);
}

.lg-tip-wrap.open .lg-tip{
  display: block;
}

@media (hover:hover){
  .lg-tip-wrap:hover .lg-tip{
    display: block;
  }
}

/* contenu */
.lg-tip .lg-tip-row{
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.lg-tip .lg-tip-row:last-child{
  border-bottom: none;
  padding-bottom: 2px;
}

.lg-tip a{
  color: #9fd0ff;
  text-decoration: none;
  font-weight: 600;
}
.lg-tip a:hover{
  color: #c7e4ff;
  text-decoration: underline;
}

.lg-tip .lg-tip-date{
  margin-top: 2px;
  color: rgba(234,242,255,.72);
  font-size: 11px;
  line-height: 1.2;
}

/* tablette/mobile: évite de sortir de l'écran */
@media (max-width: 900px){
  .lg-tip{
    left: 0;
    transform: none;
    min-width: 220px;
    max-width: min(320px, 78vw);
  }
  .lg-tip::before{
    left: 20px;
    transform: rotate(45deg);
  }
}






.lg-print-link.is-last-print{
  border-color: #fff !important;
  background: rgba(255,255,255,.08);
}





.btn.is-disabled{
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(100%);
  padding: 10px 12px 10px 12px;
}




