/* Jalon — couleurs : jaune #FFE600, anthracite #3C3C3C, fond #ECEEEF, blanc. Jamais de texte jaune sur fond blanc. */
:root { --y: #FFE600; --a: #3C3C3C; --a2: #262625; --bg: #ECEEEF; --w: #fff; --grey: #6B6B6B; --line: #D6D9DB; --red: #B3261E; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--a); font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--a); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: var(--w); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--a); outline-offset: -1px; }
textarea { resize: vertical; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* Barre du haut */
#top { background: var(--a2); color: var(--w); display: flex; align-items: center; gap: 14px; padding: 8px 16px; flex: none; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; color: var(--y); }
.brand img { width: 32px; height: 32px; }
#top select.project { width: auto; min-width: 180px; background: var(--a); color: var(--w); border-color: #555; }
#top nav { display: flex; gap: 2px; }
#top nav button { background: none; border: 0; color: #CFCFCF; padding: 7px 12px; border-radius: 6px; }
#top nav button:hover { background: #333; color: var(--w); }
#top nav button.on { color: var(--y); box-shadow: inset 0 -2px 0 var(--y); border-radius: 0; }
.spacer { flex: 1; }
.status { color: #BDBDBD; font-size: 12.5px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top .ghost { color: var(--w); border-color: #666; }

main { flex: 1; min-height: 0; overflow: auto; }

/* Boutons */
.primary { background: var(--y); color: var(--a); border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.primary:hover { filter: brightness(0.95); }
.primary:disabled { opacity: 0.6; cursor: default; }
.ghost { background: transparent; color: var(--a); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; }
.ghost:hover { border-color: var(--a); }
.ghost.wide { width: 100%; margin-top: 14px; }
.danger { color: var(--red) !important; }

.card { background: var(--w); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06); margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.hint { color: var(--grey); font-size: 12.5px; margin: 6px 0; }
.warn { background: #FFF6CC; border-left: 4px solid var(--y); padding: 8px 10px; border-radius: 4px; }
.count { color: #9A9A9A; font-weight: 400; }
.empty { color: var(--grey); padding: 30px; text-align: center; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--grey); margin: 14px 0 5px; }
label.check { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13.5px; color: var(--a); display: flex; gap: 7px; align-items: center; margin: 4px 0; cursor: pointer; }
label.check input { width: auto; }
.inline { display: flex; gap: 6px; margin-top: 8px; }
.inline input { flex: 1; }

/* Pastilles */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips > input { width: auto; flex: 1; min-width: 180px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 11px; font-size: 13px; border: 1px solid var(--line); background: var(--w); color: var(--a); }
.chip.on { background: var(--a); color: var(--w); border-color: var(--a); }
.chip.off { background: var(--w); color: var(--a); }
.chip.mixed { background: var(--w); color: var(--a); border: 1.5px dashed var(--a); cursor: pointer; }
.chip button { background: none; border: 0; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; opacity: .75; }
.chip button:hover { opacity: 1; }
button.chip:hover { border-color: var(--a); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--w); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; color: var(--a); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--a); color: var(--y); font-weight: 600; }
.seg.small { margin-top: 8px; font-size: 12.5px; }

/* Photos */
.photos { display: flex; height: 100%; }
.filters { width: 270px; flex: none; background: var(--w); padding: 14px 16px 30px; overflow-y: auto; border-right: 1px solid var(--line); }
.filters h3 { margin: 0 0 4px; }
.filters select + select { margin-top: 6px; }
.filters .chips { margin-top: 8px; }
.checks { max-height: 220px; overflow-y: auto; }
.dates { display: flex; gap: 6px; align-items: center; }
.dates input { padding: 6px; min-width: 0; flex: 1; }
.results { flex: 1; overflow-y: auto; padding: 0 18px 30px; }
.selbar { position: sticky; top: 0; z-index: 2; background: var(--a); color: var(--w); display: flex; gap: 10px; align-items: center; padding: 9px 14px; margin: 0 -18px 14px; flex-wrap: wrap; }
.selbar .ghost { color: var(--w); border-color: #777; }
.selbar.quiet { background: var(--bg); color: var(--a); }
.selbar.quiet .ghost { color: var(--a); border-color: var(--line); }
.selbar .hint { margin-left: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { background: var(--w); border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); outline: 3px solid transparent; transition: outline-color .1s; }
.tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tile.sel { outline-color: var(--y); }
.thumb { aspect-ratio: 4 / 3; background: #D9DCDE; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb img:not([src]) { visibility: hidden; }
.tile .box { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 5px; border: 2px solid var(--w); background: rgba(38,38,37,.45); color: var(--a); font-weight: 800; padding: 0; opacity: 0; }
.tile:hover .box, .tile.sel .box { opacity: 1; }
.tile.sel .box { background: var(--y); border-color: var(--y); }
.cap { padding: 7px 10px 9px; }
.cap .z { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap .d { color: var(--grey); font-size: 12px; }
.cap .k { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { display: block; margin: 18px auto; }

/* Fenêtres */
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.55); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 20px; }
.modal { background: var(--w); border-radius: 12px; padding: 20px 24px; width: 620px; max-width: 100%; max-height: 100%; overflow-y: auto; }
.modal.wide { width: 1200px; padding: 0; overflow: hidden; }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.actions { display: flex; gap: 8px; margin-top: 20px; }
.cols { display: flex; gap: 18px; flex-wrap: wrap; }
.cols > div { flex: 1; min-width: 140px; }
.cols input { width: 100%; }
.zone-edit select { margin-bottom: 6px; }
.similar { background: #FFF6CC; border-left: 4px solid var(--y); padding: 8px 10px; border-radius: 4px; margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.progress { margin-top: 10px; font-weight: 600; min-height: 1.4em; }

.detail { display: flex; height: min(80vh, 820px); }
.detail .pic { flex: 1; background: #1E1E1E; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }
.detail .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); color: var(--w); border: 0; font-size: 34px; width: 46px; height: 64px; border-radius: 6px; }
.detail .nav:hover { background: rgba(0,0,0,.7); }
.detail .prev { left: 10px; } .detail .next { right: 10px; }
.detail .info { width: 330px; flex: none; padding: 18px 20px; overflow-y: auto; }
.detail .counter { color: var(--grey); font-size: 12px; margin-bottom: 8px; }
.detail .row { margin-bottom: 10px; }
.detail .row > span { display: block; font-size: 11.5px; text-transform: uppercase; color: var(--grey); font-weight: 600; }

/* Listes, réglages */
.lists, .settings { display: flex; gap: 18px; padding: 18px; align-items: flex-start; flex-wrap: wrap; }
.lists .col, .settings .col { flex: 1; min-width: 360px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.ztree { margin-top: 10px; border-top: 1px solid var(--line); }
.zrow { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-bottom: 1px solid #F0F1F2; }
.zrow:hover { background: #F6F7F8; }
.tw { background: none; border: 0; width: 20px; color: var(--grey); padding: 0; }
.zn { font-weight: 500; }
.zact { margin-left: auto; display: flex; gap: 2px; opacity: 0; }
.zrow:hover .zact, .zact.show { opacity: 1; }
.zact button { background: none; border: 0; color: var(--grey); font-size: 12.5px; padding: 3px 6px; border-radius: 4px; }
.zact button:hover { background: var(--bg); color: var(--a); }
.plist { margin-bottom: 12px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #F0F1F2; }
.prow.cur { box-shadow: inset 4px 0 0 var(--y); padding-left: 12px; }
.welcome { max-width: 620px; margin: 60px auto; }
.welcome h1 { margin-top: 0; }
.welcome li.done { color: var(--grey); text-decoration: line-through; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); background: var(--a); color: var(--w); padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; max-width: 80vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--red); }
.thumb { position: relative; }
.thumb .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(60,60,60,.7); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; padding-left: 3px; }
.detail .pic video { max-width: 100%; max-height: 100%; background: #000; }
