/* Stories : interface sombre et sobre, dans l'esprit de Postiz */
:root {
  --bg: #0e0e10;
  --panel: #17171a;
  --panel-2: #1f1f23;
  --input: #232328;
  --bord: #2c2c32;
  --texte: #f2f2f4;
  --doux: #9a9aa3;
  --pale: #6b6b74;
  --accent: #612bd3;
  --accent-2: #7a47e6;
  --accent-fond: rgba(97, 43, 211, .16);
  --ok: #3fbf7f;
  --attente: #e0a33a;
  --err: #e5534b;
  --rayon: 10px;
  --ombre: 0 8px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--texte);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--pale); }

/* ---------- squelette ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav {
  background: var(--panel); border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.marque i { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.marque i svg { width: 15px; height: 15px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--doux); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--panel-2); color: var(--texte); }
.nav a.actif { background: var(--accent-fond); color: #fff; }
.nav .bas { margin-top: auto; border-top: 1px solid var(--bord); padding-top: 12px; }
.nav .qui { padding: 4px 10px 8px; color: var(--pale); font-size: 12px; }
.contenu { min-width: 0; }
.page { padding: 28px 32px 60px; max-width: 1280px; }
.entete { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.entete h1 { font-size: 22px; margin: 0; font-weight: 650; }
.entete .sous { color: var(--doux); }
.esp { flex: 1; }

/* ---------- éléments ---------- */
.bouton {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; padding: 9px 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.bouton:hover { background: var(--accent-2); }
.bouton svg { width: 16px; height: 16px; }
.bouton.second { background: var(--panel-2); color: var(--texte); border: 1px solid var(--bord); }
.bouton.second:hover { background: var(--input); }
.bouton.danger { background: transparent; color: var(--err); border: 1px solid rgba(229, 83, 75, .4); }
.bouton.petit { padding: 6px 11px; font-size: 13px; }
.bouton:disabled { opacity: .5; cursor: default; }
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ > span { color: var(--doux); font-size: 12.5px; font-weight: 500; }
.champ small { color: var(--pale); font-size: 12px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--bord); border-radius: 8px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-fond); }
input[type=datetime-local] { color-scheme: dark; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce {
  border: 1px solid var(--bord); background: var(--panel-2); color: var(--doux); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.puce.actif { background: var(--accent-fond); border-color: var(--accent); color: #fff; }
.segment { display: inline-flex; background: var(--panel-2); border: 1px solid var(--bord); border-radius: 9px; padding: 3px; }
.segment button { border: 0; background: transparent; color: var(--doux); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; }
.segment button.actif { background: var(--input); color: #fff; }
.carte { background: var(--panel); border: 1px solid var(--bord); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.carte h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.vide { border: 1px dashed var(--bord); border-radius: 12px; padding: 40px; text-align: center; color: var(--doux); }
.msg { background: var(--accent-fond); border: 1px solid rgba(97, 43, 211, .5); padding: 10px 14px; border-radius: 9px; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--bord); }
th { color: var(--doux); font-weight: 500; font-size: 12.5px; }
.ligne { display: flex; gap: 12px; flex-wrap: wrap; }
.ligne > * { flex: 1; min-width: 180px; }
details summary { cursor: pointer; color: var(--doux); }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.interrupteur input { display: none; }
.interrupteur i { width: 36px; height: 20px; border-radius: 99px; background: var(--input); border: 1px solid var(--bord); position: relative; flex: none; transition: .15s; }
.interrupteur i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--doux); transition: .15s; }
.interrupteur input:checked + i { background: var(--accent); border-color: var(--accent); }
.interrupteur input:checked + i::after { left: 18px; background: #fff; }

/* ---------- planning ---------- */
.filtres { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.jour { margin-bottom: 30px; }
.jour h3 { font-size: 13px; color: var(--doux); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 12px; font-weight: 600; }
.jour h3 b { color: var(--texte); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.story { background: var(--panel); border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; text-decoration: none; display: block; }
.story:hover { border-color: #45454d; transform: translateY(-2px); }
.story .vis { aspect-ratio: 9/16; background: #000 center/cover no-repeat; position: relative; }
.story .heure { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .7); padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 12.5px; }
.story .etat { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); }
.etat.programmée { background: var(--attente); } .etat.brouillon { background: #8e8ea0; } .etat.publiée { background: var(--ok); } .etat.erreur { background: var(--err); } .etat.annulée { background: var(--pale); }
.story .infos { padding: 9px 10px 11px; }
.story .compte { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story .badges { display: flex; gap: 6px; margin-top: 6px; color: var(--doux); flex-wrap: wrap; }
.story .badges span { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; background: var(--panel-2); border-radius: 6px; padding: 2px 6px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.story .badges svg { width: 12px; height: 12px; flex: none; }
.story .erreur { color: var(--err); font-size: 11.5px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- éditeur ---------- */
.editeur { display: grid; grid-template-rows: 58px 1fr; height: 100vh; }
.barre {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--bord);
}
.barre .titre { font-weight: 600; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre select, .barre input { width: auto; padding: 7px 10px; }
.retour { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--doux); text-decoration: none; }
.retour:hover { background: var(--panel-2); color: #fff; }
.retour svg { width: 18px; height: 18px; }
.atelier { display: grid; grid-template-columns: 76px 330px 1fr; min-height: 0; }
.rail { background: var(--panel); border-right: 1px solid var(--bord); display: flex; flex-direction: column; padding: 10px 8px; gap: 4px; }
.rail button {
  border: 0; background: transparent; color: var(--doux); border-radius: 10px; padding: 10px 4px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; position: relative;
}
.rail button svg { width: 21px; height: 21px; }
.rail button:hover { background: var(--panel-2); color: #fff; }
.rail button.actif { background: var(--accent-fond); color: #fff; }
.rail button .point { position: absolute; top: 7px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.volet { background: var(--panel); border-right: 1px solid var(--bord); padding: 18px; overflow-y: auto; }
.volet h2 { font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.volet .aide { color: var(--doux); font-size: 12.5px; margin: 0 0 16px; }
.scene { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-width: 0; min-height: 0; padding: 18px;
  background: radial-gradient(circle at 50% 40%, #18181c, #0b0b0d 70%); }
.telephone { border-radius: 22px; overflow: hidden; box-shadow: var(--ombre), 0 0 0 1px #2a2a30; background: #000; position: relative; }
.outils-scene { display: flex; gap: 8px; align-items: center; color: var(--doux); font-size: 12.5px; }
.depot {
  border: 1.5px dashed var(--bord); border-radius: 12px; padding: 26px 14px; text-align: center; color: var(--doux); cursor: pointer; transition: .15s;
  display: flex; flex-direction: column; align-items: center;
}
.saisie { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: #1c1c21; border: 1px solid var(--bord);
  border-radius: 10px; box-shadow: var(--ombre); padding: 5px; max-height: 340px; overflow-y: auto;
}
.suggestions .titre-s { color: var(--pale); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding: 6px 8px 4px; }
.sugg { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.sugg:hover, .sugg.focus { background: var(--panel-2); }
.sugg img, .sugg .sans { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--input); }
.sugg .t { flex: 1; min-width: 0; }
.sugg .t b { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.sugg .t b svg { width: 13px; height: 13px; flex: none; }
.sugg .t span { display: block; color: var(--doux); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg .abo { color: var(--texte); font-size: 12px; font-weight: 600; white-space: nowrap; }
.sugg .abo small { display: block; color: var(--pale); font-weight: 400; text-align: right; }
.depot:hover, .depot.survol { border-color: var(--accent); background: var(--accent-fond); color: #fff; }
.depot svg { width: 26px; height: 26px; margin-bottom: 6px; }
.fichier { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 9px; padding: 9px 11px; margin-top: 12px; font-size: 13px; }
.fichier span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; background: var(--input); border: 1px solid var(--bord); border-radius: 8px; padding: 6px; }
.etiquettes:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-fond); }
.etiquettes input { flex: 1; min-width: 120px; border: 0 !important; background: transparent; box-shadow: none !important; padding: 4px; }
.etiquette { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--bord); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.etiquette button { border: 0; background: none; color: var(--pale); cursor: pointer; padding: 0; line-height: 1; font-size: 15px; }
.etiquette button:hover { color: var(--err); }
.morceaux { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.morceau { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; }
.morceau:hover { background: var(--panel-2); }
.morceau.choisi { border-color: var(--accent); background: var(--accent-fond); }
.morceau img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--input); flex: none; }
.morceau .t { flex: 1; min-width: 0; }
.morceau .t b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.morceau .t span { color: var(--doux); font-size: 12px; }
.morceau .ok { color: var(--ok); font-size: 11px; }
.lecture { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--bord); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.lecture svg { width: 12px; height: 12px; }
.choix { background: var(--panel-2); border: 1px solid var(--bord); border-radius: 10px; padding: 10px; margin-bottom: 14px; }
.caleur { margin: 12px 0 4px; }
.caleur-haut { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.caleur-haut .temps { font-weight: 600; font-variant-numeric: tabular-nums; }
.caleur-haut .note { margin-left: auto; }
.caleur canvas { display: block; width: 100%; cursor: grab; touch-action: none; border-radius: 10px; background: #141418; }
.caleur canvas.prise { cursor: grabbing; }
.caleur canvas.mini { margin-top: 6px; background: transparent; cursor: pointer; border-radius: 6px; }
.caleur .puces { margin-top: 8px; }
.caleur .puce { padding: 3px 9px; font-size: 12px; }
.separe { border-top: 1px solid var(--bord); margin: 18px 0; }
.note { color: var(--pale); font-size: 12px; }

/* ---------- divers ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #26262c; border: 1px solid var(--bord); padding: 11px 18px; border-radius: 10px; box-shadow: var(--ombre); z-index: 50; }
.toast.err { border-color: var(--err); }
.voile { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 40; }
.voile img { max-height: 88vh; border-radius: 16px; box-shadow: var(--ombre); }
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.connexion .carte { width: 100%; max-width: 380px; }
.connexion .marque { justify-content: center; padding-bottom: 22px; }
.chargement { color: var(--doux); padding: 40px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav .bas { margin: 0; border: 0; padding: 0; }
  .atelier { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow-x: auto; }
  .editeur { height: auto; }
}
