/* Back-office FAC ArtShop V3 — mise en page type Réglages iPadOS (clair ou sombre selon le système) */
body.bo { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  body.bo {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #98989d;
    --line: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --glass: rgba(28, 28, 30, .72);
    --ok: #30d158;
    --err: #ff453a;
    --shadow: none;
  }
}

body.bo { font-size: 15px; }
.admin { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-right: .5px solid var(--line);
}
.side-head { padding: 0 6px 12px; }
.side-head strong { display: block; font: 700 22px/1.15 var(--font-d); letter-spacing: -.02em; margin-bottom: 4px; }
.side-head a { color: var(--accent); }
.side-label { margin: 18px 12px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.side-nav { margin: 0; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: .5px solid var(--line); }
.side-nav a:last-child { border-bottom: 0; }
.side-nav a.on { background: var(--accent); color: #fff; }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--fill); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.side-nav a.on .count { background: rgba(255,255,255,.25); }
.side-foot { margin: 22px 10px 0; font-size: 13px; }
.side-foot a { color: var(--accent); }
.content { padding: 28px clamp(18px, 4vw, 48px) 80px; max-width: 1100px; width: 100%; }
.content h1 { font-size: 32px; margin: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.back { color: var(--accent); font-size: 15px; display: inline-block; margin-bottom: 4px; }
h2.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; margin: 26px 0 8px 14px; }
.group:empty { display: none; }
.group.pad { padding: 16px 18px; }
.link-row:hover { background: var(--fill); color: inherit; }
.cell { display: flex; flex-direction: column; align-items: flex-end; min-width: 76px; font-size: 14px; }
.cell small { font-size: 11px; color: var(--muted); }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fill); display: inline-block; margin-top: 4px; }
.dot.on { background: var(--ok); }
.filter input { width: 100%; max-width: 360px; height: 38px; border: 0; border-radius: 10px; padding: 0 14px; background: var(--fill); color: var(--text); font: 15px var(--font); margin-bottom: 16px; }

.form label.stack { flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 6px; }
.form label.stack > span { width: auto; color: var(--muted); font-size: 13px; }
.form label.stack textarea { padding: 0; font-size: 15px; line-height: 1.5; font-family: var(--font); }
.form label > span { width: 210px; }
.switch-row { justify-content: space-between; }
.switch-row span { flex: 1; width: auto !important; }
.switch { appearance: none; -webkit-appearance: none; flex: none !important; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; cursor: pointer; transition: background .2s; padding: 0 !important; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.form input[type=color] { flex: none; width: 54px; height: 32px; padding: 0; border-radius: 8px; }
.img-field { flex-wrap: wrap; padding: 10px 16px !important; }
.img-field img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--fill); }
.img-field input[type=file] { font-size: 14px; padding: 6px 0; }
.rte-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.rte-bar button { border: 0; background: var(--fill); color: var(--text); border-radius: 8px; padding: 5px 10px; font: 13px var(--font); cursor: pointer; }
.rte-bar button.on { background: var(--accent); color: #fff; }
.rte { min-height: 140px; outline: none; font-size: 15px; line-height: 1.55; }
.rte:focus { box-shadow: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.danger-t { color: var(--err) !important; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 14px; }
.imgs figure { margin: 0; background: var(--fill); border-radius: 12px; padding: 8px; }
.imgs img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.imgs figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.imgs figcaption input[inputmode] { width: 42px; border: 0; border-radius: 6px; padding: 4px; text-align: center; background: var(--card); color: var(--text); }
.drop { display: block; border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; color: var(--muted); font-size: 14px; cursor: pointer; }
.drop input { display: block; margin-bottom: 6px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 10px; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.tile small { color: var(--muted); font-size: 13px; }
.tile strong { display: block; font: 700 28px/1.2 var(--font-d); letter-spacing: -.02em; margin-top: 4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--fill); white-space: nowrap; }
.tag.big { font-size: 14px; padding: 6px 14px; }
.tag.attente { background: #fff4d6; color: #8a5a00; }
.tag.payee, .tag.preparation { background: #dcecff; color: #0a4fa8; }
.tag.expediee, .tag.livree { background: #dcf5e3; color: #1a6b31; }
.tag.annulee { background: #fde2e2; color: #9b1c1c; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; background: var(--fill); padding: 3px; border-radius: 10px; margin-bottom: 16px; width: fit-content; max-width: 100%; }
.seg a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.seg a.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.msg.unread { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.inline { display: inline-flex; gap: 16px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card h1 { font-size: 30px; }
.login-card .form { text-align: left; margin-top: 22px; }
.login-card .form label > span { width: 120px; }

@media (prefers-color-scheme: dark) {
  .tag.attente { background: #3d2f00; color: #ffd60a; }
  .tag.payee, .tag.preparation { background: #0a2a52; color: #64d2ff; }
  .tag.expediee, .tag.livree { background: #0f3a1d; color: #30d158; }
  .tag.annulee { background: #4a1212; color: #ff6961; }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: .5px solid var(--line); }
  .side-nav { display: flex; flex-wrap: wrap; background: none; box-shadow: none; gap: 6px; }
  .side-nav a { border: 0; border-radius: 99px; background: var(--card); padding: 7px 14px; }
  .side-label { margin: 10px 4px 4px; }
  .cols { grid-template-columns: 1fr; }
  .form label > span { width: 120px; }
  .cell small { display: none; }
}

/* Champs traduits : volet repliable */
details.trad { margin-top: -14px; }
details.trad summary { display: flex; justify-content: space-between; padding: 11px 16px; cursor: pointer; font-size: 14px; color: var(--accent); list-style: none; }
details.trad summary::-webkit-details-marker { display: none; }
details.trad summary small { color: var(--muted); }
details.trad[open] summary { border-bottom: .5px solid var(--line); }

/* Statistiques */
.tile em { font-style: normal; font-size: 13px; font-weight: 600; margin-left: 6px; }
.tile em.up { color: var(--ok); } .tile em.down { color: var(--err); }
.tile .small { display: block; margin-top: 2px; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pouls 1.6s infinite; }
@keyframes pouls { 50% { opacity: .3; } }
.seg-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.seg-form .seg { margin: 0; }
.perso { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.perso input { border: 0; border-radius: 8px; padding: 6px 8px; background: var(--card); color: var(--text); font: 14px var(--font); }
.chart { width: 100%; height: 190px; display: block; }
.chart .b1 { fill: var(--accent); } .chart .b2 { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.chart g:hover rect { opacity: .75; }
.chart-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend { font-size: 13px; color: var(--muted); margin: 8px 0 0; display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend i.b1 { background: var(--accent); } .legend i.b2 { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .step { position: relative; display: grid; grid-template-columns: 1fr auto 70px; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; overflow: hidden; isolation: isolate; }
.funnel .step::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--part); background: color-mix(in srgb, var(--accent) 16%, transparent); z-index: -1; border-radius: 12px; }
.funnel .step strong { font-size: 18px; } .funnel .step em { font-style: normal; color: var(--muted); text-align: right; }
.funnel .step small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: -6px; }
.stat-table .row { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(auto-fit, minmax(60px, 1fr)); gap: 10px; padding: 9px 14px; font-size: 14px; position: relative; isolation: isolate; }
.stat-table .row:not(.head)::before { content: ""; position: absolute; inset: 3px auto 3px 0; width: var(--part, 0); background: color-mix(in srgb, var(--accent) 8%, transparent); z-index: -1; border-radius: 0 6px 6px 0; }
.stat-table .row > span:not(.lib) { text-align: right; font-variant-numeric: tabular-nums; }
.stat-table .row.head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat-table .lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-table a { color: var(--accent); }
.warn { color: var(--err); }
.tabs-cat { margin-bottom: 14px; }
.tabs-cat small { color: var(--muted); font-weight: 400; margin-left: 2px; }

/* Diaporama produits */
.row-num { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.ordre { align-items: center; gap: 6px; }
.ordre .btn[disabled] { opacity: .3; cursor: default; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pick-item { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pick-img { aspect-ratio: 1; background: var(--fill); border-radius: 10px; display: grid; place-items: center; padding: 8px; }
.pick-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pick-nom { font-size: 13px; line-height: 1.3; flex: 1; }

/* Clients et messagerie */
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); font-weight: 700; font-size: 13px; }
.tiles.mini { grid-template-columns: repeat(2, minmax(120px, 1fr)); margin: 0; }
.tiles.mini .tile { padding: 10px 14px; } .tiles.mini strong { font-size: 20px; }
.row.non-lu strong { color: var(--accent); }
.lien { color: var(--accent); }

/* Promotions, favoris, paniers (V3.10.0) */
.tag.promo-en_cours { background: #dcf5e3; color: #1a6b31; }
.tag.promo-programmee { background: #dcecff; color: #0a4fa8; }
.tag.promo-terminee, .tag.promo-desactivee { background: var(--fill); color: var(--muted); }
.promo-filtre { width: 100%; max-width: 360px; height: 38px; border: 0; border-radius: 10px; padding: 0 14px; background: var(--fill); color: var(--text); font: 15px var(--font); margin: 0 0 14px; }
.promo-cat { margin-bottom: 22px; }
.promo-cat-head { margin: 0 0 10px 4px; font-size: 14px; }
.promo-cat-head strong { font-size: 16px; margin-right: 8px; }
.promo-item { position: relative; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.promo-item input { position: absolute; top: 12px; left: 12px; width: 20px; height: 20px; accent-color: var(--accent); }
.promo-item.on { border-color: var(--accent); }
.promo-prix { font-size: 13px; } .promo-prix s { color: var(--muted); } .promo-prix strong { color: var(--accent); }
.promo-item:not(.on) .promo-prix strong { display: none; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.titre-groupe { background: var(--fill); }
@media (prefers-color-scheme: dark) {
  .tag.promo-en_cours { background: #0f3a1d; color: #30d158; }
  .tag.promo-programmee { background: #0a2a52; color: #64d2ff; }
}
.promo-item[hidden] { display: none; }
.head > .btn, .head > a.btn { flex: none; white-space: nowrap; }

.form input.court { max-width: 110px; }

.suppr-commande { margin-top: 12px; }
.tva-tete .cell { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.row.compact .cell { min-width: 84px; }
.row.compact .cell.taux { min-width: 64px; }
