:root{
  --bg:#f4f7fb;--panel:#fff;--text:#172033;--muted:#6f7b91;--line:#e5eaf2;
  --brand:#2f6fed;--brand2:#6a5cff;--success:#1f9d68;--warn:#d97706;--danger:#d64545;
  --shadow:0 10px 30px rgba(28,39,60,.08);--radius:18px;
}
*{box-sizing:border-box}html,body{margin:0;padding:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}
button,input,select,textarea{font:inherit}.hidden{display:none!important}
#loginScreen{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#eef4ff,#f8f7ff)}
.login-card{width:min(920px,100%);background:#fff;border-radius:28px;box-shadow:var(--shadow);overflow:hidden;display:grid;grid-template-columns:1.1fr .9fr}
.login-hero{padding:54px;background:linear-gradient(145deg,#163d9f,#6a5cff);color:#fff}.login-hero h1{font-size:40px;margin:0 0 12px}.login-hero p{opacity:.88;line-height:1.6}.login-panel{padding:44px}
.demo-user{border:1px solid var(--line);border-radius:16px;padding:16px;margin:12px 0;display:flex;justify-content:space-between;align-items:center;gap:10px}
.demo-user small{color:var(--muted)}
.btn{border:0;border-radius:11px;padding:10px 14px;cursor:pointer;font-weight:650}.btn-primary{background:var(--brand);color:#fff}.btn-secondary{background:#eef2f8;color:#263248}.btn-success{background:#e8f8f0;color:#11724b}.btn-danger{background:#fdecec;color:#b83232}.btn-warn{background:#fff4df;color:#9a5d00}.btn-sm{padding:7px 10px;font-size:13px}.btn:disabled{opacity:.45;cursor:not-allowed}
.app{display:grid;grid-template-columns:250px 1fr;min-height:100vh}.sidebar{background:#121a2d;color:#dce4f5;padding:18px 14px;position:sticky;top:0;height:100vh;overflow:auto}.brand{display:flex;gap:10px;align-items:center;padding:10px 10px 22px;font-weight:800;font-size:20px}.brand-badge{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#2f6fed,#6a5cff);display:grid;place-items:center;color:#fff}.nav-section{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#71809f;padding:16px 10px 8px}.nav-item{display:flex;gap:10px;align-items:center;padding:11px 12px;border-radius:11px;color:#c9d3e9;cursor:pointer;margin:3px 0}.nav-item:hover,.nav-item.active{background:#202c47;color:#fff}.nav-item .ico{width:20px;text-align:center}
.main{min-width:0}.header{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:5}.header-left{display:flex;align-items:center;gap:12px}.search-global{width:min(420px,38vw);padding:10px 13px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}.header-user{display:flex;gap:12px;align-items:center}.avatar{width:38px;height:38px;border-radius:50%;background:#e8efff;display:grid;place-items:center;font-weight:800;color:#285cc8}.content{padding:24px}.page-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:20px}.page-head h2{margin:0 0 6px;font-size:28px}.page-head p{margin:0;color:var(--muted)}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 4px 18px rgba(30,44,76,.04)}.kpi{padding:18px}.kpi-top{display:flex;justify-content:space-between;align-items:center}.kpi .value{font-size:30px;font-weight:800;margin-top:8px}.kpi .label{font-size:13px;color:var(--muted)}.kpi .bubble{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#eef4ff}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.section-card{padding:18px}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.section-title h3{margin:0;font-size:17px}.muted{color:var(--muted)}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px}.table{width:100%;border-collapse:collapse;background:#fff;min-width:760px}.table th,.table td{padding:12px 13px;text-align:left;border-bottom:1px solid var(--line);font-size:14px;vertical-align:middle}.table th{background:#f8fafc;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#67748a}.table tr:last-child td{border-bottom:0}.table tr:hover td{background:#fbfcff}
.badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:750;white-space:nowrap}.b-blue{background:#eaf1ff;color:#285cc8}.b-green{background:#e7f8ef;color:#11724b}.b-orange{background:#fff3df;color:#9b5f00}.b-red{background:#fdebec;color:#b53030}.b-gray{background:#eef1f5;color:#526077}.b-purple{background:#efeaff;color:#5e49c6}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.toolbar input,.toolbar select{border:1px solid var(--line);background:#fff;border-radius:11px;padding:10px 12px}.toolbar input{min-width:220px}.grow{flex:1}
.progress{height:9px;background:#edf1f7;border-radius:999px;overflow:hidden}.progress>span{display:block;height:100%;background:linear-gradient(90deg,#2f6fed,#6a5cff);border-radius:inherit}.progress-text{font-size:12px;color:var(--muted);margin-top:5px}
.cards-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.work-card{padding:18px}.work-card h3{margin:0 0 4px}.work-card .meta{color:var(--muted);font-size:13px}.work-card .qty{font-size:24px;font-weight:800;margin:14px 0}.work-card .actions{display:flex;gap:8px;flex-wrap:wrap}
.timeline{position:relative;padding-left:24px}.timeline:before{content:"";position:absolute;left:7px;top:4px;bottom:4px;width:2px;background:#e2e8f2}.timeline-item{position:relative;padding:0 0 18px 12px}.timeline-item:before{content:"";position:absolute;left:-21px;top:4px;width:10px;height:10px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 4px #eaf1ff}.timeline-item strong{display:block}.timeline-item small{color:var(--muted)}
.modal-backdrop{position:fixed;inset:0;background:rgba(10,16,30,.52);display:grid;place-items:center;padding:20px;z-index:50}.modal{width:min(820px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:22px;box-shadow:0 24px 70px rgba(0,0,0,.2)}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.modal-body{padding:20px 22px}.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px;border-top:1px solid var(--line)}.close-btn{border:0;background:#eef2f7;border-radius:10px;width:34px;height:34px;cursor:pointer}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:12px;font-weight:750;color:#58657b}.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:11px;padding:10px 12px;background:#fff}.field textarea{min-height:90px;resize:vertical}.product-row{display:grid;grid-template-columns:1fr 120px 42px;gap:8px;margin-bottom:8px}.sep{height:1px;background:var(--line);margin:16px 0}.note{padding:12px 14px;border-radius:12px;background:#f6f8fc;color:#526077;font-size:13px}.alert{padding:12px 14px;border-radius:12px;font-size:13px;margin-bottom:12px}.alert-warn{background:#fff4df;color:#865200}.alert-danger{background:#fdebec;color:#a92d2d}.alert-success{background:#e7f8ef;color:#116644}
.statline{display:flex;gap:16px;flex-wrap:wrap}.mini-stat{background:#f7f9fc;border:1px solid var(--line);border-radius:12px;padding:10px 12px}.mini-stat b{display:block;font-size:18px}.mini-stat span{font-size:11px;color:var(--muted)}
.empty{padding:36px;text-align:center;color:var(--muted)}.right{text-align:right}.nowrap{white-space:nowrap}.text-danger{color:var(--danger);font-weight:700}.text-success{color:var(--success);font-weight:700}.link{color:var(--brand);cursor:pointer;font-weight:700}.subtle{font-size:12px;color:var(--muted)}
@media(max-width:1100px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.cards-list{grid-template-columns:repeat(2,1fr)}.grid-2{grid-template-columns:1fr}}
@media(max-width:820px){.app{grid-template-columns:1fr}.sidebar{position:fixed;left:-260px;width:250px;z-index:20;transition:.2s}.sidebar.open{left:0}.header{padding:0 14px}.content{padding:16px}.search-global{display:none}.kpi-grid,.cards-list{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}.login-card{grid-template-columns:1fr}.login-hero{padding:30px}.login-panel{padding:28px}.mobile-menu{display:inline-flex!important}}
.mobile-menu{display:none}

/* V2.3 - interactions et lecture rapide */
.clickable-row{cursor:pointer}
.table tr.row-complete td{background:#edf9f2}
.table tr.row-complete:hover td{background:#e2f5e9}
.table tr.row-complete td:first-child{box-shadow:inset 4px 0 0 var(--success)}

/* V2.4 - filtres commandes et actions fournisseur depuis les produits */
.check-filter{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:11px;padding:8px 12px;font-size:13px;color:#4e5a70;cursor:pointer}
.toolbar .check-filter input[type="checkbox"]{min-width:auto;width:16px;height:16px;margin:0;accent-color:var(--brand)}
.compact-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.demo-user.clickable-row:hover{background:#fbfcff}


/* V2.6 - tri des grilles */
.sortable-th{cursor:pointer;user-select:none;position:relative;padding-right:24px!important}
.sortable-th:hover{background:#f0f4fa!important;color:#33415c}
.sortable-th:after{content:"↕";position:absolute;right:8px;opacity:.35;font-size:12px}
.sortable-th.sort-asc:after{content:"↑";opacity:1;color:var(--brand)}
.sortable-th.sort-desc:after{content:"↓";opacity:1;color:var(--brand)}

/* V3 · Google Sheets */
.sync-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.sync-badge.local{background:#eef2f6;color:#5a6573}
.sync-badge.online{background:#e9f8ef;color:#176b39}
.sync-badge.syncing{background:#edf4ff;color:#1f5ea8}
.sync-badge.error{background:#fff0f0;color:#a72b2b}
@media(max-width:820px){.sync-badge{display:none}}
