:root {
  --bg: #F2F3F6; --card: #fff; --ink: #131A2A; --muted: #6B7385; --line: #DCDFE6;
  --brand: #7E1A52; --brand-2: #AB1263; --plum: #2E1526; --soft: #F2E6EC; --ok: #23804F; --warn: #f59e0b; --bad: #C22F2F;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, .cb-name b, .cc-name { font-family: var(--display); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 80px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- En-tête ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.logo svg { width: 30px; height: 30px; }
nav.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav.tabs button { border: 0; background: none; padding: 9px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
nav.tabs button.on { background: var(--soft); color: var(--brand); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.who select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; max-width: 200px; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; font-size: 13px; }
.dellink { border: 0; background: none; color: var(--bad); text-decoration: underline; padding: 0; font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn { border: 1px solid var(--line); background: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 600; }
.btn:hover { border-color: #c5ccdb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #691545; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #eef1f6; color: var(--muted); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }

/* ---------- Écrans ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.screen { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.screen .pv { aspect-ratio: 16/9; background: #0f172a; position: relative; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; }
.screen .pv img { width: 100%; height: 100%; object-fit: cover; }
.screen .pv .live { position: absolute; left: 10px; top: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #94a3b8; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.dot.off { background: var(--bad); }
.screen .body { padding: 14px 16px 10px; flex: 1; }
.screen .name { font-weight: 700; font-size: 16px; }
.screen .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.screen .foot { display: flex; gap: 8px; padding: 0 12px 12px; }
.screen .foot .btn { flex: 1; }
.iconbtn { width: 42px; flex: 0 0 42px !important; padding: 8px 0; font-size: 18px; line-height: 1; }
.iconbtn.minus { color: var(--bad); }
.add-card { border: 2px dashed #D9C3CF; border-radius: var(--radius); background: transparent; min-height: 170px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--brand); font-weight: 700; }
.add-card:hover { background: var(--soft); border-color: var(--brand-2); }
.add-card .plus { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 38px; line-height: 62px; text-align: center; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Carrousels ---------- */
.cwrap { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .cwrap { grid-template-columns: 1fr; } }
.clist { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
.clist button.c { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 10px; text-align: left; font-weight: 600; }
.clist button.c.on { background: var(--soft); }
.clist button.c small { margin-left: auto; color: var(--muted); font-weight: 500; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }
.clist .new { width: 100%; margin-top: 6px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.cname { font-size: 20px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; min-width: 0; flex: 1; }
.cname:hover, .cname:focus { border-color: var(--line); outline: none; }
.colors { display: flex; gap: 6px; }
.colors button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; }
.colors button.on { border-color: var(--ink); }

.film { display: flex; gap: 12px; overflow-x: auto; padding: 14px; min-height: 182px; background: #0f172a; border-radius: 12px; align-items: flex-start; }
.film.over { outline: 3px dashed var(--brand-2); outline-offset: -3px; }
.film .hint { color: #94a3b8; margin: auto; text-align: center; padding: 20px; }
.slide { flex: 0 0 180px; background: #1e293b; border-radius: 10px; overflow: hidden; color: #e2e8f0; position: relative; cursor: grab; user-select: none; }
.slide.dragging { opacity: .35; }
.slide.drop-before { box-shadow: -4px 0 0 var(--brand-2); }
.slide .th { aspect-ratio: 16/9; background: #000; display: flex; align-items: center; justify-content: center; }
.slide .th img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slide .n { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.slide .x { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1; }
.slide .x:hover { background: var(--bad); }
.slide .dur { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; font-size: 13px; font-weight: 600; }
.slide .dur button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: #334155; color: #fff; font-size: 17px; line-height: 1; }
.slide .dur button:hover { background: var(--brand-2); }
.vtag { position: absolute; right: 6px; bottom: 44px; background: rgba(0,0,0,.65); font-size: 11px; padding: 1px 6px; border-radius: 5px; }

.drop { border: 2px dashed #D9C3CF; border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); margin-bottom: 14px; }
.drop.over { border-color: var(--brand-2); background: var(--soft); color: var(--brand); }
.drop b { color: var(--brand); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lib .m { position: relative; border-radius: 10px; overflow: hidden; background: #0f172a; cursor: grab; aspect-ratio: 16/9; }
.lib .m img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.lib .m .add { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 20px; line-height: 1; }
.lib .m .del { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; opacity: 0; }
.lib .m:hover .del { opacity: 1; }
.lib .m .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 40px 5px 7px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { margin-top: 10px; font-size: 13px; color: var(--brand); }

/* ---------- Planning ---------- */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 13px; font-weight: 600; }
.days button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.palette { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; color: #fff; font-weight: 600; cursor: grab; user-select: none; font-size: 14px; }
.plan { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px 18px; overflow-x: auto; }
.prow { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; min-width: 760px; }
.prow + .prow { margin-top: 12px; }
.prow .pn { font-weight: 700; display: flex; flex-direction: column; gap: 2px; }
.prow .pn small { font-weight: 500; color: var(--muted); }
.track { position: relative; height: 58px; border-radius: 10px; background:
  repeating-linear-gradient(135deg, #eef1f6 0 8px, #f7f8fb 8px 16px); border: 1px solid var(--line); }
.track.over { outline: 3px dashed var(--brand-2); }
.track .deflbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa3b8; font-size: 12px; pointer-events: none; }
.track .hl { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(0,0,0,.06); pointer-events: none; }
.block { position: absolute; top: 4px; bottom: 4px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 700; padding: 5px 9px;
  overflow: hidden; white-space: nowrap; cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.18); user-select: none; }
.block small { display: block; font-weight: 500; opacity: .9; font-size: 11px; }
.block .hd { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.block .hd.l { left: 0; } .block .hd.r { right: 0; }
.block .hd::after { content: ""; position: absolute; top: 30%; bottom: 30%; left: 3px; width: 3px; border-radius: 2px; background: rgba(255,255,255,.7); }
.now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--bad); pointer-events: none; z-index: 3; }
.scale { display: grid; grid-template-columns: 170px 1fr; gap: 14px; min-width: 760px; margin-bottom: 6px; }
.scale .ticks { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.scale .ticks span { position: absolute; transform: translateX(-50%); }

/* ---------- Fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 92vh; overflow: auto; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.modal input[type=text], .modal input[type=email], .modal input[type=password], .modal input[type=number], .modal input[type=time], .modal select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; align-items: center; }
.pin { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.pin input { width: 62px; height: 74px; text-align: center; font-size: 34px; font-weight: 800; border: 2px solid var(--line); border-radius: 12px; }
.pin input:focus { border-color: var(--brand); outline: none; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.switch input { width: 20px; height: 20px; }
.err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1em; }

.preview { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; align-items: center; justify-content: center; }
.preview .stage { width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16/9; position: relative; background: #000; }
.preview .stage > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .5s; }
.preview .close { position: absolute; top: 16px; right: 16px; z-index: 2; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .modal { max-width: 400px; }
.login .logo { justify-content: center; font-size: 20px; margin-bottom: 16px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Bandeau « client en cours » ---------- */
button.logo { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
.clientbar { position: sticky; top: 62px; z-index: 19; background: linear-gradient(90deg, #5E1640, #7E1A52 55%, #9A2366); color: #fff; box-shadow: 0 2px 8px rgba(126,26,82,.28); }
.cb-in { max-width: 1280px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cb-back { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.cb-back:hover { background: rgba(255,255,255,.22); }
.cb-name { display: flex; flex-direction: column; line-height: 1.15; }
.cb-name small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.cb-name b { font-size: 24px; }
.clientbar select { border-radius: 8px; padding: 6px 8px; border: 0; }
.cb-stats { display: flex; gap: 18px; font-size: 14px; opacity: .95; flex-wrap: wrap; }
.cb-stats b { font-size: 17px; }

/* ---------- Accueil admin : cartes clients ---------- */
.ccard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.ccard:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.cc-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.cc-name { font-size: 19px; font-weight: 800; color: var(--ink); }
.cc-screens { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-scr { display: inline-flex; align-items: center; gap: 6px; background: #f1f4f9; border-radius: 8px; padding: 4px 9px; font-size: 13px; font-weight: 600; }
.cc-meta, .cc-acc { color: var(--muted); font-size: 13px; }
.cc-go { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cc-go .btn { padding: 7px 10px; font-size: 13px; }
.cc-go .btn.primary { margin-left: auto; }
.who span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .who span { display: none; } .cb-name b { font-size: 20px; } }

.modal input[type=radio] { width: 18px; height: 18px; }
/* ---------- Médiathèque : dossiers ---------- */
.folders { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fchip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 600; font-size: 14px; }
.fchip small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.fchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fchip.on small { color: #F2E6EC; }
.fchip.over { outline: 3px dashed var(--brand-2); background: var(--soft); color: var(--brand); }
.fbar { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; font-size: 14px; }
.lib .m .used { position: absolute; left: 6px; top: 6px; background: rgba(22,163,74,.9); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.lib .m .edit { position: absolute; right: 34px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; opacity: 0; }
.lib .m:hover .edit { opacity: 1; }
.lib .m .lbl small { opacity: .85; }
@media (hover: none) { .lib .m .edit, .lib .m .del { opacity: 1; } }

/* ---------- Admin : arborescence à gauche ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 62px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.side button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; border-radius: 10px; cursor: pointer; }
.side small { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; }
.nav0 { padding: 11px 12px; font-weight: 800; font-size: 14px; letter-spacing: .04em; color: var(--ink); }
.nav0.on { background: var(--brand); color: #fff; }
.nav0.on small { color: #F2E6EC; }
.tree { margin: 6px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.nav1 { padding: 9px 10px; font-weight: 700; font-size: 15px; color: var(--ink); margin-top: 2px; }
.nav1 span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav1:hover, .nav2:hover, .nav0:not(.on):hover { background: #f1f4f9; }
.nav1.cur { background: var(--soft); color: var(--brand); }
.sub2 { margin: 2px 0 6px 16px; padding-left: 10px; border-left: 2px solid #E6CFDB; }
.nav2 { padding: 8px 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.nav2.on { background: var(--brand); color: #fff; }
.nav-new { margin-top: 14px; justify-content: center; border: 1px dashed #D9C3CF !important; color: var(--brand); font-weight: 700; padding: 9px; }
.content { min-width: 0; }
.content .clientbar { top: 62px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
.cb-push { border: 0; background: #fff; color: var(--brand); border-radius: 10px; padding: 9px 16px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.cb-push:hover { background: var(--soft); }
.cb-push:disabled { opacity: .85; cursor: default; }
.nav-app { margin-top: 18px; padding: 8px 10px; font-size: 13px; color: var(--muted) !important; font-weight: 600; }
.nav-app:hover { background: #f1f4f9; }

/* ---------- Orientation ---------- */
.screen .pv.portrait { aspect-ratio: auto; height: 240px; }
.screen .pv.portrait img { width: auto; height: 100%; aspect-ratio: 9/16; object-fit: cover; }
.rots { display: flex; flex-direction: column; gap: 6px; }
.rot { display: flex !important; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 0 !important; font-weight: 600; cursor: pointer; }
.rot.on { border-color: var(--brand); background: var(--soft); }
.rot input { display: none; }
.rot .ico { width: 30px; height: 18px; border: 2.5px solid currentColor; border-radius: 3px; flex: 0 0 auto; }
.rot .ico.p { width: 18px; height: 30px; }
/* « TOUS LES CLIENTS » : simple titre */
div.nav0 { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; cursor: default; border-bottom: 2px solid var(--line); border-radius: 0; padding-bottom: 10px; }
.reco { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: #fef3c7; color: #92400e; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.reco .btn { padding: 6px 12px; font-size: 13px; }
.lib .m .del.out { font-size: 15px; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f1f4f9; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: 14px; }
.bulk .btn { padding: 5px 12px; }
.bulk small { color: var(--muted); }
.cb-acc { border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.cb-acc:hover { background: rgba(255,255,255,.22); }
.appline { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; margin: -6px 0 18px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal:has(table.t) { max-width: 720px; }
.modal table.t select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; }
.btn.danger-txt { color: var(--bad); }
.btn.danger-txt:hover { border-color: #fca5a5; background: #fef2f2; }
.screen .foot .btn { white-space: nowrap; padding: 9px 10px; }
.code10 { font: 800 26px/1 ui-monospace, Menlo, monospace; letter-spacing: .2em; text-align: center; background: #fef2f2; color: #991b1b; border: 1px dashed #fca5a5; border-radius: 10px; padding: 14px; margin: 4px 0 10px; user-select: none; }
.meta.adb { margin-top: 4px; }
.meta .copy { cursor: copy; color: var(--brand); text-decoration: underline dotted; }
.syncline { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: -6px 0 14px; font-size: 14px; cursor: pointer; }
.syncline input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.syncline span { color: var(--muted); } .syncline b { color: var(--ink); }

/* =====================================================================
   TÉLÉPHONE (la plupart des clients passent par là)
   ===================================================================== */
.bnav, .mpick, .mhome { display: none; }
.mv { position: absolute; left: 6px; bottom: 44px; display: flex; gap: 4px; }
.mv button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; }
.mv button:disabled { opacity: .3; }
.addslot { padding: 3px 9px !important; font-size: 12px; margin-left: 6px; }
.pn-t { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.track { cursor: copy; }
.block { touch-action: none; }

@media (max-width: 760px) {
  html, body { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; } /* évite le zoom automatique de l'iPhone */
  header.top { height: 54px; padding: 0 14px; gap: 10px; }
  header.top .logo span { font-size: 15px; }
  header.top nav.tabs { display: none; }
  .who span { display: none; }
  main { padding: 16px 14px 96px; }
  h1 { font-size: 20px; }
  .sub { font-size: 13px; margin-bottom: 14px; }

  /* barre de navigation en bas */
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
  .bnav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px;
    font-weight: 700; font-size: 12px; color: var(--muted); }
  .bnav button span { font-size: 20px; line-height: 1.1; }
  .bnav button.on { color: var(--brand); background: var(--soft); }

  /* admin : l'arborescence devient un menu déroulant dans le bandeau */
  .side { display: none; }
  .shell { display: block; min-height: 0; }
  .mpick { display: block; max-width: 60%; border-radius: 10px; border: 0; padding: 8px 10px; font-weight: 700; background: #fff; color: var(--brand); }
  .mhome { display: block; padding: 12px 14px 0; }
  .mhome .mpick { max-width: 100%; width: 100%; border: 1px solid var(--line); }

  /* bandeau client compact */
  .clientbar { top: 54px; }
  .content .clientbar { top: 54px; }
  .cb-in { padding: 10px 14px; gap: 10px; }
  .cb-name b { font-size: 18px; }
  .cb-name small { font-size: 10px; }
  .cb-stats { display: none; }
  .cb-acc { padding: 6px 10px; font-size: 13px; }

  /* écrans */
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .add-card { min-height: 90px; flex-direction: row; }
  .add-card .plus { width: 44px; height: 44px; font-size: 28px; line-height: 42px; }
  .syncline, .appline { font-size: 13px; }
  .row { gap: 8px; }

  /* carrousels */
  .cwrap { grid-template-columns: 1fr; gap: 12px; }
  /* carrousels les uns sous les autres (pas de défilement horizontal, peu visible sur téléphone) */
  .clist { padding: 6px; }
  .clist button.c { padding: 12px; }
  .panel { padding: 14px; border-radius: 12px; }
  .film { padding: 10px; gap: 10px; min-height: 150px; }
  .slide { flex-basis: 150px; }
  .bulk { font-size: 13px; }
  .panel .row input[type=search], .panel .row select { flex: 1 1 140px; width: auto !important; }
  .lib { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .drop { padding: 16px 12px; }
  .drop .desk { display: none; }

  /* planning : une ligne par écran, pleine largeur */
  .plan { padding: 12px; overflow: visible; }
  .scale, .prow { grid-template-columns: 1fr; min-width: 0; gap: 6px; }
  .scale > span:first-child { display: none; }
  .scale .ticks span { display: none; }
  .scale .ticks span:nth-child(3n+1) { display: inline; }
  .prow + .prow { margin-top: 16px; }
  .track { height: 54px; }
  .block { font-size: 11px; padding: 4px 6px; }
  .block small { font-size: 10px; }
  .block .hd { width: 14px; }
  .days { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .days button { flex: 0 0 auto; padding: 7px 10px; }
  .palette { display: none; } /* le glisser-déposer n'existe pas au doigt : « + Plage » à la place */

  /* fenêtres : plein écran par le bas */
  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100% !important; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; }
  .modal .actions { flex-wrap: wrap; }
  .modal table.t { display: block; overflow-x: auto; }
  .pin input { width: 56px; height: 66px; font-size: 30px; }
  #toast { bottom: 84px; }
  .login .modal { border-radius: 18px; }
  .login .overlay, .login { align-items: center; }
}
/* une colonne de grille ne doit jamais s'élargir à cause d'un contenu qui défile (pellicule, planning) */
.cwrap > *, .shell > *, .grid > * { min-width: 0; }
@media (max-width: 760px) {
  .has-pick .cb-name b { display: none; }
  .has-pick .mpick { max-width: 100%; flex: 1; }
}
@media (max-width: 760px) { .modal .days { flex-wrap: wrap; overflow: visible; } .modal .days button { flex: 1 0 auto; } }
.block .bk-hint { display: block; font-style: normal; font-weight: 500; font-size: 10px; opacity: .8; margin-top: 1px; }
.block:hover .bk-hint { opacity: 1; text-decoration: underline; }
.days .alldays { font-weight: 800; }
.days .alldays.on { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 760px) { .track { height: 64px; } .block .bk-hint { font-size: 9px; } }
.track { height: 68px; }
.modal .btn.allday { white-space: nowrap; padding: 10px 12px; font-weight: 800; }
.modal .btn.allday.on { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 760px) { .modal .btn.allday { flex: 1 0 100%; } }


/* =====================================================================
   Identité VETTER (comme VETTER Gestion)
   ===================================================================== */
header.top { background: var(--plum); border-bottom: 0; color: #fff; }
header.top .linkbtn, .who { color: rgba(255,255,255,.75); }
.logo { color: #fff; gap: 10px; }
.logo b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; flex: none; }
.logo b svg { width: 27px; height: 27px; }
.logo span { font: 700 17px/1.05 var(--display); letter-spacing: .02em; }
.logo small { display: block; font: 400 12px "Inter", sans-serif; opacity: .7; letter-spacing: 0; }
header.top nav.tabs button { color: rgba(255,255,255,.75); }
header.top nav.tabs button.on { background: rgba(255,255,255,.14); color: #fff; }
.login .logo { color: var(--plum); justify-content: center; }
.login .logo b { background: var(--soft); }
.login .modal { box-shadow: 0 20px 60px rgba(46,21,38,.18); }

/* barre latérale prune foncé (admin) */
.side { background: var(--plum); border-right: 0; color: #fff; }
.side small { color: rgba(255,255,255,.55); }
div.nav0 { color: rgba(255,255,255,.6); border-bottom-color: rgba(255,255,255,.12); }
.tree { border-left-color: rgba(255,255,255,.14); }
.nav1 { color: #fff; }
.nav1:hover, .nav2:hover, .nav-app:hover { background: rgba(255,255,255,.08) !important; }
.nav1.cur { background: rgba(255,255,255,.12); color: #fff; }
.sub2 { border-left-color: rgba(255,255,255,.18); }
.nav2 { color: rgba(255,255,255,.72); }
.nav2.on { background: rgba(255,255,255,.16); color: #fff; }
.nav-new { color: #fff !important; border-color: rgba(255,255,255,.3) !important; background: transparent !important; }
.nav-app { color: rgba(255,255,255,.6) !important; }
.side .dot { box-shadow: none; }

.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: #691545; }
.cb-push, .mpick { color: var(--brand); }
.cb-ren { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 8px; width: 30px; height: 30px; font-size: 14px; margin-left: 4px; }
.cb-ren:hover { background: rgba(255,255,255,.28); }
.cb-name b { display: inline-flex; align-items: center; }
.bnav button.on { color: var(--brand); background: var(--soft); }
.chip, .block { box-shadow: 0 2px 6px rgba(46,21,38,.18); }
.fchip.on, .days button.on, .nav2.on { }

input[type=checkbox], input[type=radio] { accent-color: var(--brand); }

/* ---------- Espace utilisé ---------- */
.usage { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.usage i { display: inline-block; width: 90px; height: 7px; border-radius: 99px; background: #E6E8EE; overflow: hidden; }
.usage em { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.usage.warn em { background: var(--warn); }
.usage.full em { background: var(--bad); }
.usage.full b { color: var(--bad); }
.usage.bar-in { color: rgba(255,255,255,.85); }
.usage.bar-in i { background: rgba(255,255,255,.25); }
.btn.clean { font-size: 13px; padding: 6px 12px; margin-left: auto; }
.simple-tag { background: rgba(255,255,255,.2); border-radius: 6px; padding: 0 6px; text-transform: none; letter-spacing: 0; }
.ccard .usage { margin-top: -2px; }

/* ---------- Mode simplifié : « Mes images » ---------- */
.drop.big { padding: 28px 16px; font-size: 16px; background: #fff; border-color: #D9C3CF; cursor: pointer; }
.drop.big b { font-size: 18px; }
.simple-tools { margin: 0 0 14px; justify-content: space-between; }
.simple-tools .bulk { margin: 0; }
.simple-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sitem { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.sitem .th { aspect-ratio: 16/9; background: #111; position: relative; display: flex; align-items: center; justify-content: center; color: #fff; }
.sitem .th img { width: 100%; height: 100%; object-fit: cover; }
.sitem .n { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 1px 8px; font-weight: 800; font-size: 13px; }
.sitem .vtag { bottom: 8px; right: 8px; }
.sbar { display: flex; gap: 6px; padding: 8px; align-items: center; }
.sbar button { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 44px; height: 38px; font-size: 15px; }
.sbar button:disabled { opacity: .35; }
.sbar .sdel { color: var(--bad); }
@media (max-width: 760px) {
  .simple-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sbar button { width: 38px; height: 36px; }
  .simple-tools { flex-direction: column; align-items: stretch; }
}

/* ---------- Menu de gauche : client en cours uniquement ---------- */
.side { display: flex; flex-direction: column; gap: 4px; }
.side .spacer { flex: 1; }
.curcli { padding: 10px 12px 12px; }
.curcli b { display: block; font: 700 18px/1.2 var(--display); color: #fff; }
.curcli small { display: block; margin-top: 3px; color: rgba(255,255,255,.6) !important; font-size: 12px; margin-left: 0 !important; }
.side .sub2 { margin: 0 0 8px; padding-left: 0; border-left: 0; }
.side .nav2 { font-size: 15px; padding: 10px 12px; }
.nav-switch { margin-top: 6px; justify-content: center; background: rgba(255,255,255,.1) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.22) !important; font-weight: 700; padding: 10px; }
.nav-switch:hover { background: rgba(255,255,255,.18) !important; }
.side-hint { color: rgba(255,255,255,.6); font-size: 13px; margin: 6px 12px; }
.mswitch { display: none; }
@media (max-width: 760px) { .mswitch { display: inline-block; } }
.simplebar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 14px; }
.simplebar input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.simplebar.on { background: var(--soft); border-color: var(--brand); }
.transline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 0 0 14px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.shell.solo { grid-template-columns: 1fr; }
.cn-ico { flex: none; padding: 3px 5px; border-radius: 7px; font-size: 18px; line-height: 1; cursor: pointer; }
.cn-ico:hover { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.c .cn-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.clean { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.clean:hover { background: #a32626; border-color: #a32626; color: #fff; }
/* vignettes de la médiathèque : crayon et corbeille au survol */
.lib .m .mact { position: absolute; right: 6px; top: 6px; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; }
.lib .m:hover .mact, .lib .m:focus-within .mact { opacity: 1; }
.lib .m .mact button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.95); box-shadow: 0 1px 4px rgba(0,0,0,.35); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.lib .m .mact button:hover { transform: scale(1.08); }
.lib .m .mact button[data-delm]:hover { background: #fde2e2; }
@media (hover: none) { .lib .m .mact { opacity: 1; } }
/* téléphone : vignettes plus grandes (2 par ligne) pour que « Utilisé », ✏️ 🗑️ et + ne se chevauchent pas */
@media (max-width: 760px) {
  .lib { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib .m .mact { gap: 4px; right: 5px; top: 5px; }
  .lib .m .mact button { width: 28px; height: 28px; font-size: 14px; }
  .lib .m .used { left: 5px; top: 5px; font-size: 10px; padding: 2px 5px; }
  .lib .m .add { width: 28px; height: 28px; font-size: 18px; right: 5px; bottom: 5px; }
  .lib .m .lbl { padding-right: 38px; }
}
/* téléphone : le menu de gauche est remplacé par la barre du bas et « ⇄ Changer » (règle placée après .side { display: flex }) */
@media (max-width: 760px) { .side { display: none; } .shell { grid-template-columns: 1fr; } }
/* téléphone : ✏️ 🗑️ calés à droite, sans le nombre d'éléments */
@media (max-width: 760px) { .clist button.c .cn-txt { flex: 1; } .clist button.c small { display: none; } }
