/* IZGESTIA CAFÉ — modèle IZGestia (pages de gestion) */
:root {
  --navy: #1e293b; --slate: #334155; --slate-2: #475569; --muted: #64748b; --muted-2: #94a3b8;
  --line: #e2e8f0; --line-2: #eef2f6; --bg: #e9eef5; --soft: #f8fafc;
  --cyan: #06b6d4; --cyan-2: #22d3ee; --teal: #0891b2; --teal-2: #0e7490; --mint: #34d399; --green: #10b981;
  --red: #ef4444; --orange: #f97316; --amber: #f59e0b; --indigo: #6366f1; --purple: #a855f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--navy); font-size: 14px; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
.app { max-width: 1680px; margin: 6px auto; background: #fff; border-radius: 16px; overflow: clip; box-shadow: 0 2px 14px rgba(15, 23, 42, .08); min-height: calc(100vh - 12px); }

/* ---------- En-tête IZGESTIA ---------- */
.hero { position: relative; text-align: center; color: #fff; padding: 46px 20px 40px;
  background: radial-gradient(900px 260px at 50% -30%, rgba(148, 163, 184, .38), transparent 65%), linear-gradient(135deg, #1e293b 0%, #2c3a52 45%, #4b5a7a 100%); }
.brand { display: flex; align-items: center; justify-content: center; gap: 16px; }
.logo-ic { width: 66px; height: 66px; filter: drop-shadow(0 4px 10px rgba(34, 211, 238, .35)); }
.brand h1 { margin: 0; font-size: 54px; font-weight: 800; letter-spacing: 5px; line-height: 1;
  background: linear-gradient(90deg, #a855f7 0%, #b979f8 55%, #d8b4fe 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { margin-top: 20px; color: #9aa8bd; letter-spacing: 2.5px; font-size: 15px; }
.badge-role { display: inline-block; margin-left: 10px; padding: 4px 13px; border-radius: 20px; background: rgba(255, 255, 255, .14); color: #e2e8f0; font-weight: 700; font-size: 12px; letter-spacing: .4px; vertical-align: 1px; }
.hero-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.fs-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #0e7490; color: #fff; font-size: 16px; box-shadow: 0 4px 12px rgba(14, 116, 144, .45); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.fs-btn.pos { background: #6b4a33; box-shadow: 0 4px 12px rgba(107, 74, 51, .45); }

/* ---------- Onglets ---------- */
nav.tabs { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 0 6px; padding: 4px 24px 0; background: #fff; border-bottom: 1px solid var(--line); }
nav.tabs a { display: inline-flex; align-items: center; gap: 9px; padding: 15px 15px 13px; color: var(--slate-2); font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs a i { color: var(--muted); font-size: 15px; }
nav.tabs a:hover { color: var(--teal); }
nav.tabs a.active { color: var(--teal); border-bottom-color: var(--teal); }
nav.tabs a.active i { color: var(--teal); }
nav.tabs a.logout { margin-left: auto; color: var(--red); }
nav.tabs a.logout i { color: var(--red); }
nav.tabs a .ext { font-size: 10px; margin-left: -3px; opacity: .7; }

main { padding: 26px 30px 50px; min-height: 60vh; }
.page-title { display: flex; align-items: center; gap: 13px; margin: 0 0 22px; padding-left: 14px; border-left: 5px solid #0ea5c6; font-size: 27px; font-weight: 800; color: var(--navy); }
.page-title > i { color: var(--navy); font-size: 24px; }
.page-title .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.sec-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: var(--navy); margin: 0 0 14px; }
.sec-title > i { color: var(--slate); }
.sec-title .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.loading { padding: 50px; text-align: center; color: var(--muted); }

/* ---------- Cartes / formulaires ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); margin-bottom: 18px; min-width: 0; }
.card.cyan { border-color: #67e8f9; }
.card.flat { box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.span2 { grid-column: span 2; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 0; }
.field { min-width: 0; }
.lbl { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--slate); margin-bottom: 6px; }
.lbl i { color: var(--teal); margin-right: 3px; }
.inp, select.inp, textarea.inp { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13.5px; color: var(--navy); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.inp:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6, 182, 212, .14); }
.inp.cyan { border-color: #22d3ee; }
.inp[readonly] { background: var(--soft); }
textarea.inp { min-height: 70px; resize: vertical; }
.inp-group { display: flex; }
.inp-group .inp { border-radius: 8px 0 0 8px; }
.inp-group .addon { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid #cbd5e1; border-left: 0; border-radius: 0 8px 8px 0; background: var(--soft); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.inp-group select.addon { padding: 0 8px; color: var(--navy); font-weight: 600; outline: none; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.hint i { margin-right: 4px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.sep.dash { border-top: 1.5px dashed #67e8f9; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; cursor: pointer; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--teal); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 13px; color: #fff; text-decoration: none; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-cyan { background: var(--cyan); }
.btn-teal { background: #14b8a6; }
.btn-mint { background: #4ade80; background: linear-gradient(180deg, #4ade80, #34d399); }
.btn-green { background: var(--green); }
.btn-dark { background: var(--slate); }
.btn-red { background: var(--red); box-shadow: 0 3px 8px rgba(239, 68, 68, .3); }
.btn-orange { background: var(--orange); }
.btn-amber { background: var(--amber); }
.btn-indigo { background: var(--indigo); }
.btn-purple { background: #8b5cf6; }
.btn-ghost { background: #f1f5f9; color: var(--slate); }
.btn-outline { background: #fff; color: var(--slate); border: 1px solid #cbd5e1; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; margin-top: 14px; }
.ab { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 21px; border: 0; border-radius: 5px; color: #fff; font-size: 10.5px; margin: 0 1px; vertical-align: middle; }
.ab.view { background: #06b6d4; } .ab.print { background: #14b8a6; } .ab.edit { background: #f59e0b; } .ab.del { background: #ef4444; }
.ab.dark { background: #475569; } .ab.green { background: #10b981; } .ab.indigo { background: #6366f1; } .ab.orange { background: #f97316; }

/* ---------- Tableaux ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; background: #fff; }
.tbl thead th { background: var(--slate); color: #fff; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; font-weight: 700; padding: 11px 12px; text-align: left; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #f8fbff; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl .nw { white-space: nowrap; }
.tbl tfoot td { font-weight: 800; background: var(--soft); border-top: 2px solid var(--line); }
.tbl tr.annule td { color: #94a3b8; text-decoration: line-through; }
.tbl tr.annule td.keep { text-decoration: none; }
.tbl tr.day td { background: #ecfeff; font-weight: 800; color: var(--teal-2); }
.amt { font-weight: 700; white-space: nowrap; }
.amt small { font-size: 10px; font-weight: 700; margin-left: 2px; opacity: .8; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: #ea580c; } .teal { color: var(--teal); } .slate { color: var(--slate); }
.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--soft); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); vertical-align: middle; }
.empty-row { text-align: center; color: var(--muted); padding: 26px !important; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.b-ok { background: #dcfce7; color: #15803d; } .b-warn { background: #fef3c7; color: #b45309; } .b-ko { background: #fee2e2; color: #b91c1c; }
.b-info { background: #e0f2fe; color: #0369a1; } .b-gray { background: #f1f5f9; color: #475569; } .b-purple { background: #f3e8ff; color: #7e22ce; } .b-cyan { background: #cffafe; color: #0e7490; }

/* ---------- Barres d'outils ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.search-inp { position: relative; }
.search-inp i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 13px; }
.search-inp .inp { padding-left: 34px; border-radius: 10px; }
.seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--slate-2); display: inline-flex; align-items: center; gap: 7px; }
.seg button.on { background: #fff; color: var(--teal); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.seg button.on.cam { color: #7e22ce; }
.seg button.on.cmp { color: #c2410c; }
.quick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid #cbd5e1; background: #fff; border-radius: 20px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--slate); }
.quick button:hover { border-color: var(--cyan); color: var(--teal); }
.date-nav { display: inline-flex; align-items: center; gap: 6px; }
.date-nav .inp { width: 160px; }
.date-nav button:not(.btn) { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: var(--slate); }
.date-nav .btn { height: 36px; }

/* ---------- Indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; border-radius: 14px; padding: 16px 18px; color: #fff; overflow: hidden; background: linear-gradient(135deg, #0891b2, #06b6d4); box-shadow: 0 4px 14px rgba(8, 145, 178, .22); }
.kpi::after { content: ''; position: absolute; right: -18px; top: -18px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; opacity: .9; }
.kpi .v { font-size: 25px; font-weight: 800; margin-top: 6px; line-height: 1.15; }
.kpi .v small { font-size: 13px; font-weight: 700; }
.kpi .s { font-size: 11.5px; opacity: .9; margin-top: 4px; }
.kpi i.bg { position: absolute; right: 14px; bottom: 12px; font-size: 26px; opacity: .3; }
.kpi.green { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 4px 14px rgba(5, 150, 105, .22); }
.kpi.indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); box-shadow: 0 4px 14px rgba(79, 70, 229, .22); }
.kpi.amber { background: linear-gradient(135deg, #d97706, #f59e0b); box-shadow: 0 4px 14px rgba(217, 119, 6, .22); }
.kpi.red { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 4px 14px rgba(220, 38, 38, .22); }
.kpi.slate { background: linear-gradient(135deg, #334155, #475569); box-shadow: 0 4px 14px rgba(51, 65, 85, .22); }
.kpi.purple { background: linear-gradient(135deg, #7e22ce, #a855f7); box-shadow: 0 4px 14px rgba(126, 34, 206, .22); }
.alert { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.alert i { margin-top: 2px; }
.alert.info { background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; }
.alert.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; display: block; }
.alert.purple { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* barres simples (graphiques) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 40px 4px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b .col { width: 100%; max-width: 46px; border-radius: 4px 4px 0 0; background: #0891b2; min-height: 2px; position: relative; }
.bars .b.today .col { background: #0e7490; }
.bars .b .val { font-size: 11px; font-weight: 700; color: var(--slate); margin-bottom: 5px; white-space: nowrap; }
.bars .b .lab { font-size: 11px; color: var(--muted); padding-top: 6px; white-space: nowrap; width: 100%; text-align: center; border-top: 1px solid #cbd5e1; }
.bars .b.today .lab { color: var(--navy); font-weight: 700; }
.bars .b { position: relative; cursor: default; }
.bars .b .col { border-bottom: 0; }
.bars .b:hover .col { background: #0e7490; }
.bars .b[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; top: 0; transform: translate(-50%, -100%); white-space: pre; background: #0f172a; color: #fff; padding: 7px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; line-height: 1.45; z-index: 6; box-shadow: 0 6px 16px rgba(15, 23, 42, .25); pointer-events: none; }
.bars-axis { border-top: 1px solid var(--line); margin: 0 4px; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 12.5px; }
.hbar .n { width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .t { flex: 1; height: 10px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.hbar .t span { display: block; height: 100%; background: #0891b2; border-radius: 5px; }
.hbar .v { width: 80px; text-align: right; font-weight: 700; white-space: nowrap; }

/* ---------- Achats (modèle IZGestia) ---------- */
.cart-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.cart-head .t { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cart-head .r { justify-self: end; }
.cart-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 12px; }
.cart-total { text-align: right; font-weight: 800; font-size: 15px; padding: 10px 0 4px; }
.paym { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.paym button { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 7px; font-weight: 700; font-size: 12.5px; color: var(--slate); }
.paym button i { font-size: 20px; color: var(--muted); }
.paym button.on { border-color: var(--indigo); background: #eef2ff; color: #3730a3; }
.paym button.on i { color: var(--indigo); }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(15, 23, 42, .14); max-height: 260px; overflow-y: auto; margin-top: 3px; }
.ac-list div { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; }
.ac-list div:hover, .ac-list div.on { background: #ecfeff; }
.ac-list div small { color: var(--muted); }
.rel { position: relative; }
.preview-line { font-size: 12px; color: var(--teal-2); background: #ecfeff; border-radius: 8px; padding: 8px 12px; margin-top: 10px; }

/* ---------- Fournisseurs ---------- */
.sup-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.sup-list { padding: 14px; }
.sup-list .search-inp { margin-bottom: 12px; }
.sup-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; cursor: pointer; }
.sup-item:hover, .sup-item.on { background: #f1f5f9; }
.sup-item .ic { color: var(--navy); font-size: 15px; width: 20px; }
.sup-item .nm { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-item .nm small { display: block; font-weight: 600; font-size: 11px; color: var(--red); }
.sup-item .nm small.ok { color: var(--green); }
.sup-item .ob { width: 42px; height: 30px; border-radius: 9px; border: 0; background: var(--orange); color: #fff; font-size: 13px; box-shadow: 0 3px 8px rgba(249, 115, 22, .35); }
.sup-empty { text-align: center; padding: 70px 20px; }
.sup-empty i { font-size: 70px; color: #64748b; }
.sup-empty h3 { margin: 20px 0 0; font-size: 20px; }
.sup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.sup-head h2 { margin: 0; font-size: 22px; }
.sup-head .info { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tabs-mini { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs-mini button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; font-size: 13px; }
.tabs-mini button.on { color: var(--teal); border-bottom-color: var(--teal); }

/* ---------- Produits ---------- */
.ph-box { width: 100%; aspect-ratio: 1; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--soft); color: var(--muted-2); flex-direction: column; gap: 8px; text-align: center; font-size: 12px; cursor: pointer; }
.ph-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph-box i { font-size: 34px; }
.prod-form { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
.rows-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.rows-tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--slate); padding: 6px; border-bottom: 1px solid var(--line); }
.rows-tbl td { padding: 5px 6px; vertical-align: middle; }
.rows-tbl .inp { padding: 7px 9px; }
.sumbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sumbar span { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; }
.sumbar b { color: var(--navy); }
.pill-sec { background: #ecfeff; color: #0e7490; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-block; margin-bottom: 10px; letter-spacing: .4px; text-transform: uppercase; }

/* ---------- Utilisateurs ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.perm { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.perm input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--teal); flex-shrink: 0; }
.perm .t { font-weight: 700; font-size: 13px; }
.perm .t i { color: var(--teal); width: 18px; }
.perm .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.perm.on { border-color: #67e8f9; background: #f0fdff; }
.perm.danger .t i { color: #7e22ce; }
.perm.danger.on { border-color: #d8b4fe; background: #faf5ff; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- Paramètres / caméra ---------- */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.subtabs button { border: 1px solid var(--line); background: #fff; border-radius: 22px; padding: 9px 16px; font-weight: 700; font-size: 13px; color: var(--slate); display: inline-flex; gap: 8px; align-items: center; }
.subtabs button.on { background: var(--slate); border-color: var(--slate); color: #fff; }
.subtabs button.cam.on { background: #7e22ce; border-color: #7e22ce; }
.logo-prev { width: 150px; height: 150px; border: 2px dashed #cbd5e1; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; color: var(--muted-2); }
.logo-prev img { max-width: 100%; max-height: 100%; }
.zone-editor { position: relative; width: 100%; background: #0f172a; border-radius: 12px; overflow: hidden; user-select: none; touch-action: none; }
.zone-editor img { display: block; width: 100%; height: auto; }
.zone-editor .noimg { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; color: #94a3b8; text-align: center; padding: 20px; font-size: 13px;
  background-image: linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px); background-size: 40px 40px; }
.zone-editor canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.zone-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.zbtn { border: 2px solid; background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.zbtn .dot { width: 12px; height: 12px; border-radius: 50%; }
.zbtn.on { color: #fff !important; }
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 12px; color: var(--slate); }
.legend div { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.status-dot.on { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }
.status-dot.off { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }
.status-dot.never { background: #94a3b8; }
.keybox { font-family: Consolas, 'Courier New', monospace; font-size: 13px; background: #0f172a; color: #67e8f9; padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.chips-folder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips-folder button { border: 1px solid #cbd5e1; background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12px; font-family: Consolas, monospace; color: var(--slate); }
.bib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bib { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.bib h4 { margin: 0 0 4px; font-size: 14.5px; }
.bib .d { font-size: 12.5px; color: var(--slate-2); margin: 8px 0; white-space: pre-wrap; }
.bib-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.bib-photos .ph { position: relative; width: 62px; height: 62px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.bib-photos .ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.bib-photos .ph button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(239, 68, 68, .9); color: #fff; font-size: 10px; }
.bib-photos .add { width: 62px; height: 62px; border-radius: 8px; border: 2px dashed #cbd5e1; background: #fff; color: var(--muted); font-size: 18px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pc .img { aspect-ratio: 4 / 3; background: #0f172a; display: flex; align-items: center; justify-content: center; color: #64748b; overflow: hidden; }
.pc .img img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.pc .b { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; flex: 1; }
.pc .pred { color: var(--slate-2); }
.pc .inp { padding: 7px 9px; font-size: 12.5px; }
.pc .acts { display: flex; gap: 6px; margin-top: auto; }
.pc .acts .btn { flex: 1; }
.import-drop { border: 2px dashed #a5f3fc; background: #f0fdff; border-radius: 12px; padding: 22px; text-align: center; }
.import-drop i { font-size: 34px; color: var(--cyan); }
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .9); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* les classes utilitaires de couleur (.green, .red…) ne doivent pas teinter les boutons et indicateurs */
.ab, .kpi { color: #fff !important; }

/* ---------- Fenêtres ---------- */
body.modal-open { overflow: hidden; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 36px 14px; overflow-y: auto; }
.modal { background: #fff; width: 100%; max-width: 680px; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); overflow: hidden; }
.modal.sm { max-width: 440px; }
.modal.lg { max-width: 980px; }
.modal.xl { max-width: 1180px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #1e293b, #334155); color: #fff; }
.modal-h h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.modal-h h3 i { color: #67e8f9; }
.modal-x { border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; flex-shrink: 0; }
.modal-b { padding: 20px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.confirm-msg { font-size: 14.5px; line-height: 1.55; margin: 0 0 10px; }

/* ---------- Notifications ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); animation: tin .25s ease-out; line-height: 1.4; }
.toast i { margin-top: 2px; color: #34d399; }
.toast.err i { color: #fca5a5; }
.toast.warn i { color: #fcd34d; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .35s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Connexion ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(900px 500px at 50% 0%, #334155, #0f172a); }
.login-wrap { width: 100%; max-width: 440px; }
.login-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login-hero { text-align: center; padding: 34px 20px 26px; background: radial-gradient(600px 200px at 50% -30%, rgba(148, 163, 184, .38), transparent 65%), linear-gradient(135deg, #1e293b 0%, #2c3a52 45%, #4b5a7a 100%); color: #fff; }
.login-hero .brand h1 { font-size: 40px; letter-spacing: 4px; }
.login-hero .logo-ic { width: 50px; height: 50px; }
.login-hero .sub { color: #9aa8bd; font-size: 12.5px; letter-spacing: 2px; margin-top: 14px; }
.login-body-in { padding: 24px 26px 26px; }
.login-body-in h2 { margin: 0 0 6px; font-size: 20px; text-align: center; }
.login-body-in .lbl { margin-top: 12px; }
.login-body-in .inp { padding: 11px 13px; font-size: 14.5px; }
.login-logo { display: block; max-height: 70px; max-width: 160px; margin: 0 auto 10px; }
.login-err { color: #dc2626; font-weight: 600; font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; }
  .hero, nav.tabs, .toolbar, .no-print, .btn, .ab, #toasts { display: none !important; }
  .app { box-shadow: none; margin: 0; }
  main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .tbl thead th { background: #e2e8f0 !important; color: #0f172a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols, .grid4 { grid-template-columns: 1fr 1fr; }
  .sup-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { padding: 18px 14px 40px; }
  .hero { padding: 64px 14px 28px; }
  .brand h1 { font-size: 36px; letter-spacing: 3px; }
  .logo-ic { width: 46px; height: 46px; }
  .hero .sub { font-size: 12px; letter-spacing: 1.2px; }
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; padding: 0 8px; }
  nav.tabs a { padding: 13px 11px 11px; font-size: 13.5px; }
  .page-title { font-size: 21px; }
  .grid2, .grid3, .grid4, .cols, .prod-form, .legend { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .paym { grid-template-columns: 1fr 1fr; }
  .cart-head { grid-template-columns: 1fr auto; }
  .cart-head > :nth-child(2) { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  .modal-b { padding: 16px; }
}
