/* ===== Charte v16 : blanc dominant, bleu, jaune ; fond à lignes légères ; cartes KPI en dégradés ===== */
:root{--v16-bl:#2563eb;--v16-bl2:#1d4ed8;--v16-ye:#fde047;--v16-ye2:#f59e0b;--v16-navy:#0f1d3d}

/* fond de l'application : blanc-lavande avec lignes diagonales très légères */
body{background-color:#f6f7fc!important;background-image:repeating-linear-gradient(135deg,rgba(37,99,235,.045) 0 1px,transparent 1px 26px)!important}

/* menu déplié : fond blanc, onglet en cours en jaune */
#side{background:#fff!important;border-right:1px solid #edf1f8}
#menu button{border-radius:12px}
#menu button:hover{background:#f3f6fc}
#menu button.on{background:linear-gradient(135deg,var(--v16-ye),var(--v16-ye2))!important;color:#1f1600!important;font-weight:650!important;box-shadow:0 8px 18px rgba(245,158,11,.30)}
#menu button.on .ic{color:#1f1600}
#menu button.on .badge{background:#1f1600;color:var(--v16-ye)}

/* menu réduit : colonne bleue, icônes seules, onglet en cours en blanc */
body.side-small #side{background:var(--v16-bl)!important;border-right:0}
body.side-small #menu button{color:rgba(255,255,255,.9)}
body.side-small #menu button:hover{background:rgba(255,255,255,.14);color:#fff}
body.side-small #menu button.on{background:#fff!important;color:var(--v16-bl)!important;box-shadow:none}
body.side-small #menu button.on .ic{color:var(--v16-bl)}
body.side-small .brand i,body.side-small .brand span{color:#fff}

/* boutons principaux : dégradé bleu */
.btn.p,.lgbtn{background:linear-gradient(135deg,#3b82f6,#1d4ed8)!important;border-color:transparent!important;color:#fff!important;box-shadow:0 10px 22px rgba(37,99,235,.28)!important;border-radius:12px}
.btn.p:hover{filter:brightness(1.05)}

/* onglets : seul l'onglet en cours prend la couleur */
.tabs2 button,.seg button{color:#6b7691;background:transparent;border-color:transparent;box-shadow:none}
.tabs2 button.on,.seg button.on{background:linear-gradient(135deg,#3b82f6,#1d4ed8)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 6px 14px rgba(37,99,235,.28)}

/* cartes KPI du tableau de bord : dégradés et motif de points */
.kcard{position:relative;border:0!important;border-radius:20px!important;color:#fff!important;overflow:hidden;box-shadow:0 14px 30px rgba(15,29,61,.12)!important;padding:20px 22px!important;animation:v16up .6s cubic-bezier(.2,.7,.2,1) both}
.kcard::before{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.22) 1.2px,transparent 1.4px);background-size:14px 14px;pointer-events:none}
.kcard::after{content:"";position:absolute;width:150px;height:150px;border-radius:50%;border:26px solid rgba(255,255,255,.12);right:-52px;top:-60px;pointer-events:none}
.kcard>*{position:relative;z-index:1}
.kcard small,.kcard .v,.kcard .dl{color:#fff!important}
.kcard .dl.up,.kcard .dl.dn{color:#fff!important}
.kcard.c1{background:linear-gradient(135deg,#3b82f6,#1d4ed8 60%,#1e3a8a)!important;box-shadow:0 14px 30px rgba(37,99,235,.35)!important}
.kcard.c2{background:linear-gradient(135deg,#34d399,#16a34a)!important;box-shadow:0 14px 30px rgba(22,163,74,.30)!important}
.kcard.c3{background:linear-gradient(135deg,#fde047,#f59e0b)!important;box-shadow:0 14px 30px rgba(245,158,11,.30)!important}
.kcard.c3 small,.kcard.c3 .v,.kcard.c3 .dl{color:#1f1600!important}
.kcard.c4{background:linear-gradient(135deg,#fb7185,#dc2626)!important;box-shadow:0 14px 30px rgba(220,38,38,.30)!important}
.kcard .ki{background:rgba(255,255,255,.22)!important;color:#fff!important;border-radius:12px}
.kcard.c3 .ki{background:rgba(255,255,255,.45)!important;color:#1f1600!important}
@keyframes v16up{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* page de connexion : blanc dominant, panneau bleu, touches de jaune */
.lgbg{background:#fff!important;background-image:repeating-linear-gradient(135deg,rgba(37,99,235,.04) 0 1px,transparent 1px 28px)!important}
.lgcard{background:#fff!important;border:1px solid #e6ecf7;box-shadow:0 40px 90px rgba(15,29,61,.14)!important;animation:v16up .9s cubic-bezier(.2,.7,.2,1) both}
.lgleft{background:linear-gradient(150deg,#3b82f6 0%,#1d4ed8 55%,#0f2a6e 100%)!important;color:#fff}
.lgtxt h4{color:#fde68a}
.lgf{background:#fff!important;border:1px solid #e6ecf7!important;border-radius:14px}
.lgf:focus-within{border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.12)!important}

@media (prefers-reduced-motion:reduce){.kcard,.lgcard{animation:none!important}}

/* liste « À traiter » sur le tableau de bord (remplace « Dernières ventes ») */
.todo{display:flex;flex-direction:column;gap:10px}
.todo .btn{width:100%;justify-content:flex-start;text-align:left;height:auto;min-height:44px;padding:11px 14px;border-radius:12px;background:#f6f8fd;border:1px solid #e9eef7;color:#0f1d3d;box-shadow:none;font-weight:600}
.todo .btn:hover{background:#eef4ff}
.todo .btn.d{background:#fdecec;border-color:#fbd5d5;color:#b91c1c}
.todo .btn.d:hover{background:#fbe0e0}
.todo .btn{justify-content:flex-start;align-items:center}
.todo .btn::before{content:"";width:8px;height:8px;border-radius:50%;background:#2563eb;flex:none;margin-right:12px}
.todo .btn.d::before{background:#dc2626}
.todo .btn::after{content:"À faire";margin-left:auto;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;background:#fff6d6;color:#8a5a00;white-space:nowrap}
.todo .btn.d::after{content:"Urgent";background:#fde2e2;color:#b91c1c}
.todo .trow.th{display:flex;justify-content:space-between;font-size:12px;color:#8a94a6;padding:0 14px 2px;font-weight:500}

/* Barre réduite en jaune (icônes foncées, élément actif blanc) */
body.side-small #side{background:linear-gradient(180deg,#fde047,#f59e0b)!important}
body.side-small #menu button{color:#0f1d3d!important}
body.side-small #menu button:hover{background:rgba(255,255,255,.45)!important;color:#0f1d3d!important}
body.side-small #menu button.on{background:#fff!important;color:#0f1d3d!important}
body.side-small #menu button.on .ic{color:#0f1d3d!important}
body.side-small .brand i,body.side-small .brand span{color:#0f1d3d!important}

/* Lignes de tableau compactes : une seule ligne, texte coupé proprement */
td,th{height:36px!important;padding:0 10px!important;font-size:13px!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;max-width:200px}
th{font-size:12px!important;color:#8a94a6!important;font-weight:500!important}

/* Dernières ventes : tableau simple, une ligne par vente */
.rv-h,.rv-r{display:grid;grid-template-columns:2.4fr 1.2fr 1fr 1fr 1fr;align-items:center;gap:12px}
.rv-h{font-size:12px;color:#8a94a6;padding:4px 8px 10px;border-bottom:1px solid #eef2f8}
.rv-h span:last-child{text-align:right}
.rv-r{height:52px;border-bottom:1px solid #eef2f8;font-size:13px;color:#0f1d3d;padding:0 8px}
.rv-r:last-child{border-bottom:0}
.rv-r>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.rv-c{display:flex;align-items:center;gap:10px}
.rv-c i{width:32px;height:32px;border-radius:50%;background:#eaf1ff;color:#2563eb;font-style:normal;font-weight:700;font-size:11px;display:flex;align-items:center;justify-content:center;flex:none}
.rv-c b{font-weight:600;overflow:hidden;text-overflow:ellipsis;min-width:0}
.rv-n,.rv-d{color:#6b7385}
.rv-p{font-style:normal;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;background:#e7f7ec;color:#1f7a3d}
.rv-m{font-weight:700;text-align:right}

/* Liste du stock : nom lisible en entier, catégories en texte simple, colonnes aérées */
#stocklist td{height:auto!important;padding:12px 12px!important;white-space:normal!important;max-width:none!important;overflow:visible!important;text-overflow:clip;vertical-align:middle}
#stocklist .pname b{white-space:normal!important;font-size:15px;font-weight:600;color:#0f1d3d;line-height:1.35;display:block}
#stocklist .spec{color:#6b7385;margin-top:2px}
#stocklist .cats{display:block;margin-top:4px;white-space:normal}
#stocklist .catchip{display:inline;background:none!important;border:0!important;padding:0!important;color:#8a94a6!important;font-size:12px;font-weight:300;white-space:normal}
#stocklist .catchip+.catchip::before{content:" · ";color:#c3cad8}
#stocklist th:nth-child(2),#stocklist td:nth-child(2){width:15%}
#stocklist th:nth-child(3),#stocklist td:nth-child(3){width:16%}
#stocklist th:nth-child(4),#stocklist td:nth-child(4){width:14%}

/* Caisse : Entrée et Sortie alignées à gauche, cellules alignées en haut, bouton Bon compact */
td.nl,th.nl{text-align:left;white-space:nowrap}
table:has(th.nl) td{vertical-align:top}
table:has(th.nl) th{vertical-align:bottom}
td.bonc{white-space:nowrap;width:1%;text-align:right}

#stocklist .cats,#stocklist .spec{font-weight:300}

/* Liste du stock : une seule ligne par produit, comme le tableau de référence */
#stocklist td{padding:8px 12px!important;vertical-align:middle;white-space:nowrap!important}
#stocklist td:first-child{max-width:none!important;overflow:hidden}
#stocklist .pname{display:flex;align-items:center;gap:10px;min-width:0;overflow:hidden}
#stocklist .pname>div{display:flex;align-items:baseline;gap:8px;min-width:0;overflow:hidden;white-space:nowrap}
#stocklist .pname b{display:inline;font-size:14px;font-weight:600;color:#0f1d3d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#stocklist .spec,#stocklist .cats{display:inline;margin:0;font-weight:300;font-size:12px;color:#8a94a6;white-space:nowrap}
#stocklist .catchip{white-space:nowrap}

/* Liste du stock : toutes les colonnes visibles, largeurs fixes */
#stocklist table{table-layout:fixed;width:100%}
#stocklist th:nth-child(1),#stocklist td:nth-child(1){width:34%}
#stocklist th:nth-child(2),#stocklist td:nth-child(2){width:11%}
#stocklist th:nth-child(3),#stocklist td:nth-child(3){width:14%}
#stocklist th:nth-child(4),#stocklist td:nth-child(4){width:13%}
#stocklist th:nth-child(5),#stocklist td:nth-child(5){width:28%}
#stocklist td:last-child{white-space:normal!important;text-align:right}
#stocklist td:last-child .btn{margin:2px 2px;white-space:nowrap}

/* Stock : colonne actions réduite, nom de produit élargi */
#stocklist th:nth-child(1),#stocklist td:nth-child(1){width:42%}
#stocklist th:nth-child(5),#stocklist td:nth-child(5){width:20%}

/* Stock : plus d'espace vide entre Alerte et Actions ; le nom prend la place récupérée */
#stocklist th:nth-child(1),#stocklist td:nth-child(1){width:50%}
#stocklist th:nth-child(5),#stocklist td:nth-child(5){width:16%}
#stocklist th:last-child{text-align:right}
#stocklist td:last-child{text-align:right}

/* Options du haut : couleurs délavées quand non choisies, couleur pleine quand on clique. Sans ombre. */
.ivtabs button{border:0!important;font-weight:600;box-shadow:none!important;color:#1d2b4f!important;background:linear-gradient(135deg,#a9c2f7,#8fb0f0)!important}
.ivtabs button:nth-child(4n+2){background:linear-gradient(135deg,#a8dcc0,#8fd1ad)!important}
.ivtabs button:nth-child(4n+3){background:linear-gradient(135deg,#f6e6a0,#f1d775)!important}
.ivtabs button:nth-child(4n){background:linear-gradient(135deg,#f2b3b3,#eb9a9a)!important}
.ivtabs button.on{color:#fff!important;background:linear-gradient(135deg,#3b82f6,#1d4ed8)!important}
.ivtabs button.on:nth-child(4n+2){background:linear-gradient(135deg,#34d399,#16a34a)!important}
.ivtabs button.on:nth-child(4n+3){color:#0f1d3d!important;background:linear-gradient(135deg,#fde047,#f59e0b)!important}
.ivtabs button.on:nth-child(4n){background:linear-gradient(135deg,#fb7185,#dc2626)!important}

/* Page de connexion : panneau gauche jaune */
.lgleft{background:linear-gradient(150deg,#fde047 0%,#f59e0b 100%)!important;color:#0f1d3d!important}
.lgtxt h4{color:#0f1d3d!important}

/* Rapports imprimés : en-tête avec logo, lignes fines sur une seule ligne, en-tête de tableau jaune */
@media print{
 .rep-head{display:block!important;margin:0 0 14px!important;padding-bottom:12px!important;border-bottom:1px solid #e5e7eb!important}
 .rep-head .rh{display:flex;justify-content:space-between;align-items:center}
 .rep-head .rh img{height:42px;display:block}
 .rep-head .rh .ct{font-size:9pt;color:#6b7280;text-align:right;line-height:1.5}
 .rep-head h2{display:none!important}
 .rep-head .rep-ed{font-size:8.5pt;color:#9ca3af;margin-top:6px}
 main h2{border-left:0!important;padding:0!important;font-size:17pt!important;font-weight:600!important;margin:14px 0 10px!important}
 .card:has(table){border:0!important;box-shadow:none!important;padding:0!important;background:#fff!important}
 table{border-collapse:collapse!important;border-spacing:0!important}
 th{background:linear-gradient(90deg,#fde047,#fbbf24)!important;color:#111!important;border:0!important;font-size:9pt!important;font-weight:700!important;padding:6px 8px!important;white-space:nowrap!important;text-transform:none!important;letter-spacing:0!important}
 td{background:transparent!important;color:#111!important;border:0!important;border-bottom:1px solid #f1f3f6!important;font-size:9pt!important;padding:5px 8px!important;white-space:nowrap!important;max-width:none!important;height:auto!important}
 td small{display:block;font-size:7.5pt;font-weight:300;color:#9ca3af}
 tr.tot td{font-weight:700!important;border-top:1px solid #9ca3af!important;border-bottom:0!important}
}

/* En-tête des rapports imprimés : couleurs de l'entreprise (crème et orange) */
@media print{
   .rep-head{background:#FFC430!important;border-bottom:4px solid #222222!important;padding:12px 16px!important;margin:0 0 16px!important;color:#222222!important}
  .rep-head .rh img{height:52px!important}
  .rep-head .rh .ct,.rep-head .rep-ed{color:#222222!important}
  main h2{border-bottom:0!important}
  main h2:before{content:"";display:inline-block;width:10px;height:22px;background:#FFC430;margin-right:10px;vertical-align:middle}
  th{background:#222222!important;color:#FFFFFF!important}
  td{color:#222222!important}
  td small{color:#5E5A52!important}
  tr.tot td{background:#FFC430!important;color:#222222!important;border-top:0!important}
}

/* Impression : tous les tableaux des rapports, même style que stock et maintenance */
@media print{
  .noprint,.sidebar,aside,nav{display:none!important}
  .card{border:0!important;box-shadow:none!important;background:#fff!important;padding:0!important}
  table{border:0!important;border-collapse:collapse!important;width:100%!important}
  th{background:linear-gradient(90deg,#fde047,#fbbf24)!important;color:#111!important;border:0!important;font-size:9pt!important;padding:6px 8px!important;white-space:nowrap!important}
  td{border:0!important;border-bottom:1px solid #f1f3f6!important;padding:5px 8px!important;font-size:9pt!important;color:#111!important;background:transparent!important;white-space:nowrap!important}
  tr.tot td{background:transparent!important;font-weight:700!important;border-top:1px solid #9ca3af!important;border-bottom:0!important}
  h3{font-size:12pt!important;margin:12px 0 6px!important;border:0!important}
}
