.card{background:#fff;border:1px solid #e2e8f0;border-radius:.75rem;padding:1.25rem;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.input,select.input,textarea.input{width:100%;border:1px solid #cbd5e1;border-radius:.5rem;padding:.5rem .75rem;background:#fff;font-size:.95rem}
.input:focus{outline:2px solid var(--p-ring);outline-offset:-1px;border-color:var(--p-base)}
.label{display:block;font-size:.8rem;font-weight:600;color:#475569;margin-bottom:.25rem}
.btn{display:inline-flex;align-items:center;gap:.4rem;background:var(--p-base);color:var(--p-on);padding:.5rem 1rem;border-radius:.5rem;font-weight:500;font-size:.9rem;white-space:nowrap}
.btn:hover{background:var(--p-hover)}.btn:focus-visible,.btn-ghost:focus-visible,a:focus-visible,button:focus-visible{outline:2px solid var(--p-ring);outline-offset:2px}
.btn-danger{background:#e11d48;color:#fff}.btn-danger:hover{background:#be123c}
.btn-ghost{display:inline-flex;align-items:center;padding:.4rem .75rem;border-radius:.5rem;border:1px solid #e2e8f0;background:#fff;font-size:.875rem}
.btn-ghost:hover{background:#f1f5f9}
table.tbl{width:100%;font-size:.9rem}table.tbl th{text-align:left;font-size:.75rem;text-transform:uppercase;color:#64748b;padding:.6rem;border-bottom:1px solid #e2e8f0}
table.tbl td{padding:.6rem;border-bottom:1px solid #f1f5f9;vertical-align:top}table.tbl tr:hover td{background:#f8fafc}
@media (max-width:767px){table.tbl thead{display:none}table.tbl tr{display:block;border-bottom:1px solid #e2e8f0;padding:.5rem 0}table.tbl td{display:block;border:0;padding:.15rem .5rem}table.tbl td[data-l]:before{content:attr(data-l) " : ";font-weight:600;color:#64748b;font-size:.8rem}}
.flash-ok{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}.flash-error{background:#fff1f2;color:#9f1239;border:1px solid #fecdd3}
.theme-switch{display:inline-flex;border:1px solid #e2e8f0;border-radius:999px;padding:2px;background:#f8fafc}
.theme-switch button{width:30px;height:28px;border-radius:999px;font-size:14px;line-height:1;opacity:.55}
.theme-switch button.on{background:#fff;opacity:1;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.logo-dark{display:none}html.dark .logo-light{display:none}html.dark .logo-dark{display:block}

/* ===== Mode sombre (surcharge des utilitaires Tailwind + composants) ===== */
html.dark body{background:#0b1220;color:#e2e8f0}
html.dark .bg-white,html.dark header,html.dark nav#nav{background:#111a2e}
html.dark .bg-slate-50{background:#0b1220}html.dark .bg-slate-100{background:#1e293b}
html.dark .card{background:#111a2e;border-color:#24324d;box-shadow:none}
html.dark .border,html.dark .border-b,html.dark .border-t,html.dark .divide-y>*{border-color:#24324d}
html.dark .text-slate-800,html.dark .text-slate-700{color:#e2e8f0}
html.dark .text-slate-600{color:#cbd5e1}html.dark .text-slate-500{color:#94a3b8}html.dark .text-slate-400{color:#7c8aa3}
html.dark .text-rose-600,html.dark .text-rose-700{color:#fda4af}
html.dark .label{color:#cbd5e1}
html.dark .input,html.dark select.input,html.dark textarea.input{background:#0b1220;border-color:#334155;color:#e2e8f0}
html.dark .input::placeholder{color:#64748b}
html.dark .btn-ghost{background:#162036;border-color:#334155;color:#e2e8f0}html.dark .btn-ghost:hover{background:#1e2a44}
html.dark .btn-danger{background:#e11d48}
html.dark table.tbl th{color:#94a3b8;border-color:#24324d}html.dark table.tbl td{border-color:#1b263d}html.dark table.tbl tr:hover td{background:#16213a}
html.dark .bg-slate-100.text-slate-700{background:#273449;color:#e2e8f0}
html.dark .bg-emerald-100{background:rgba(16,185,129,.18);color:#6ee7b7}
html.dark .bg-sky-100{background:rgba(14,165,233,.18);color:#7dd3fc}
html.dark .bg-amber-100{background:rgba(245,158,11,.18);color:#fcd34d}
html.dark .bg-rose-100{background:rgba(244,63,94,.18);color:#fda4af}
html.dark .bg-amber-50{background:rgba(245,158,11,.1);border-color:rgba(245,158,11,.35);color:#fde68a}
html.dark .flash-ok{background:rgba(16,185,129,.12);color:#a7f3d0;border-color:rgba(16,185,129,.35)}
html.dark .flash-error{background:rgba(244,63,94,.12);color:#fecdd3;border-color:rgba(244,63,94,.35)}
html.dark .theme-switch{background:#0b1220;border-color:#334155}html.dark .theme-switch button.on{background:#273449}
html.dark .bg-slate-200{background:#334155}
html.dark .border-slate-300{border-color:#475569}
html.dark .platform-logo{background:#fff;border-radius:.35rem;padding:2px}
html.dark .agency-logo{background:#f8fafc;border-radius:.4rem;padding:3px 6px}

/* ===== Couleurs de marque (variables générées par inc/Colors.php) ===== */
:root{--p-base:#4f46e5;--p-hover:#4338ca;--p-on:#fff;--p-text:#4f46e5;--p-soft:#eef2ff;--p-soft-text:#4338ca;--p-ring:#818cf8;--s-base:#10b981;--s-text:#047857;--s-soft:#d1fae5;--s-soft-text:#065f46;--logo-p:#4f46e5;--logo-s:#10b981}
.text-accent{color:var(--p-text)}.hover-accent:hover{color:var(--p-text)}
.border-accent{border-color:var(--p-base)}.border-accent-soft{border-color:var(--p-ring)}.hover-border-accent:hover{border-color:var(--p-ring)}
.accent-brand{accent-color:var(--p-base)}
.chip-on{background:var(--p-soft)!important;border-color:var(--p-ring)!important;color:var(--p-soft-text)!important}
.bg-accent-grad{background-image:linear-gradient(to bottom right,var(--p-soft),var(--s-soft))}
.navlink.active{border-color:var(--p-base);color:var(--p-text)}
.badge-accent{background:var(--p-soft);color:var(--p-soft-text)}
.badge-secondary{background:var(--s-soft);color:var(--s-soft-text)}
.stat-num{color:var(--p-text)}
.bar{background:var(--p-base);border-radius:.4rem;height:.75rem}.bar-2{background:var(--s-base)}
.bar-track{background:#eef2f7;border-radius:.4rem}html.dark .bar-track{background:#1e293b}
.swatch{width:2.5rem;height:2.5rem;border-radius:.5rem;border:1px solid #cbd5e1;padding:0;cursor:pointer;background:none}
.theme-switch button.on{outline:2px solid var(--p-ring);outline-offset:-2px}
.logo-muted{fill:#475569}html.dark .logo-muted{fill:#cbd5e1}
.logo-on-dark .logo-muted{fill:#cbd5e1}.logo-on-light .logo-muted{fill:#475569}

/* ---------- v1.4 : onglets, zones de dépôt, tri photos ---------- */
.tabs{display:flex;gap:.25rem;overflow-x:auto;scrollbar-width:thin;margin-bottom:-1px;position:relative;z-index:1}
.tab{white-space:nowrap;padding:.6rem 1rem;border:1px solid transparent;border-bottom:0;border-radius:.75rem .75rem 0 0;font-size:.875rem;font-weight:600;color:#64748b;background:transparent;cursor:pointer}
.tab:hover{color:var(--p-text)}
.tab[aria-selected=true]{background:#fff;border-color:#e2e8f0;color:var(--p-text);box-shadow:inset 0 3px 0 var(--p-base)}
.tab:focus-visible{outline:2px solid var(--p-ring);outline-offset:-2px}
html.dark .tab{color:#94a3b8}
html.dark .tab[aria-selected=true]{background:#1e293b;border-color:#334155;color:var(--p-text)}
.rounded-tl-none{border-top-left-radius:0!important}
.dropzone{position:relative;border:2px dashed #cbd5e1;border-radius:.9rem;padding:1.25rem;text-align:center;cursor:pointer;transition:border-color .15s,background .15s;background:#f8fafc}
.dropzone:hover,.dropzone:focus-visible{border-color:var(--p-base);outline:none}
.dropzone.is-over{border-color:var(--p-base);background:var(--p-soft);transform:scale(1.005)}
.dz-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.dz-icon{font-size:1.6rem;line-height:1;color:var(--p-text)}
.dz-text{font-weight:600;margin-top:.35rem;font-size:.9rem}
.dz-hint{font-size:.75rem;color:#64748b;margin-top:.15rem}
.dz-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:.6rem;margin-top:.9rem;text-align:left}
.dz-list:empty{display:none}
.dz-item{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:.6rem;overflow:hidden;font-size:.7rem}
.dz-item img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.dz-file{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;font-weight:800;font-size:1rem;color:var(--p-text);background:var(--p-soft)}
.dz-cap{display:block;padding:.3rem .4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dz-rm{position:absolute;top:.25rem;right:.25rem;width:1.5rem;height:1.5rem;border-radius:999px;background:rgba(15,23,42,.75);color:#fff;font-size:1rem;line-height:1}
html.dark .dropzone{background:#0f172a;border-color:#475569}
html.dark .dropzone.is-over{background:var(--p-soft)}
html.dark .dz-item{background:#1e293b;border-color:#334155}
html.dark .dz-hint{color:#94a3b8}
.sort-item{cursor:grab;border-radius:.6rem;padding:.25rem;border:1px solid transparent;transition:transform .15s}
.sort-item:focus-visible{outline:2px solid var(--p-ring)}
.sort-item.is-dragging{opacity:.45;border-color:var(--p-base)}
.cover-badge{display:none;position:absolute;left:.4rem;top:.4rem;background:var(--p-base);color:var(--p-on);font-size:.65rem;font-weight:700;padding:.1rem .45rem;border-radius:999px}
.sortable .sort-item:first-child .cover-badge{display:inline-block}
.sort-status{font-size:.75rem;color:#64748b;margin-top:.4rem;min-height:1em}
[hidden]{display:none!important}
