/* ===== KOUWWA Cloud — Dashboard ===== */
:root {
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-dark: #4f46e5;
  --brand-light: #eef2ff;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e8eaf1;
  --border-strong: #d8dde7;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --sky: #0ea5e9;
  --sidebar: #0f1729;
  --sidebar-2: #131c33;
  --sidebar-text: #94a3b8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --shadow-md: 0 4px 12px rgba(16,24,40,.06), 0 12px 32px rgba(16,24,40,.08);
  --shadow-lg: 0 24px 60px rgba(16,24,40,.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd2e0; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb7ca; background-clip: content-box; }

/* ===== Login ===== */
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.login-top {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 32px;
  position: relative; z-index: 2;
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.login-brand-light { color: var(--brand); font-weight: 700; }
.login-pill { font-size: 12.5px; font-weight: 600; color: var(--brand-dark); background: var(--brand-light); padding: 7px 14px; border-radius: 99px; }
.login-top-actions { display: flex; align-items: center; gap: 12px; }
.lang-select {
  border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-size: 13px; font-weight: 600;
  padding: 7px 10px; border-radius: 9px; cursor: pointer; outline: none;
}
.lang-select:hover { border-color: var(--brand); }
.lang-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

.login-split { flex: 1; display: grid; grid-template-columns: 1fr 1.05fr; grid-template-rows: 1fr; align-items: stretch; gap: 0; min-height: 0; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-form-box { width: 100%; max-width: 380px; }
.login-form-box h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 8px; }
.login-form-box .sub { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin-bottom: 30px; }

.input-ico { position: relative; display: flex; align-items: center; }
.input-ico > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; z-index: 1; }
/* Sélecteur renforcé pour primer sur la règle générique .field input (évite que le texte passe sous l'icône) */
.field .input-ico input, .input-ico input {
  width: 100%; padding-top: 13px; padding-bottom: 13px; padding-left: 44px; padding-right: 44px;
  border: 1px solid var(--border-strong); border-radius: 11px; outline: none; font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input-ico input:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(99,102,241,.15); }
.input-ico input:focus ~ svg { color: var(--brand); }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); padding: 7px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pw-eye svg { width: 18px; height: 18px; }
.pw-eye:hover { color: var(--brand); background: var(--bg-2); }
.login-btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 6px; }
.login-foot { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }

.login-hero {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6366f1 100%);
  display: flex; align-items: center; justify-content: center; padding: 48px 40px; position: relative; overflow: hidden;
}
/* Mur d'images en défilement continu HORIZONTAL (2 bandes, sens opposés) */
.hero-wall { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 16px 0; }
.hero-row { display: flex; gap: 16px; will-change: transform; animation: heroLeft 40s linear infinite; }
.hero-row.right { animation-name: heroRight; }
.hero-pic { width: 220px; height: 290px; border-radius: 16px; background-size: cover; background-position: center; flex-shrink: 0; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
@keyframes heroLeft { from { transform: translateX(0); } to { transform: translateX(-33.333%); } }
@keyframes heroRight { from { transform: translateX(-33.333%); } to { transform: translateX(0); } }
.hero-scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(135deg, rgba(49,46,129,.86) 0%, rgba(79,70,229,.74) 50%, rgba(99,102,241,.7) 100%); }
.login-hero-inner { position: relative; z-index: 2; max-width: 460px; color: #fff; text-align: center; }
.login-hero-inner h2 { font-size: 27px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 22px; line-height: 1.25; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.login-feats { list-style: none; display: inline-flex; flex-direction: column; gap: 11px; text-align: left; margin-bottom: 30px; }
.login-feats li { font-size: 15px; opacity: .96; text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.login-shots { display: flex; gap: 12px; justify-content: center; }
.login-shot {
  width: 110px; height: 78px; border-radius: 12px; background-size: cover; background-position: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.25);
  transition: transform .2s;
}
.login-shot:hover { transform: translateY(-4px) scale(1.03); }

@media (max-width: 860px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-pill { display: none; }
}

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  transition: transform .2s ease; border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px; padding: 22px 20px;
  color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .3px;
}
.brand-badge {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 21px; flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,.45);
}
.nav { flex: 1; padding: 10px 12px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #4b5774;
  padding: 14px 14px 6px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: var(--sidebar-text); text-decoration: none; font-size: 14px; margin-bottom: 3px;
  font-weight: 500; transition: all .15s; position: relative;
}
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active {
  background: var(--brand-grad); color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px rgba(99,102,241,.4);
}
.nav a.active svg { opacity: 1; }
.sidebar .foot { padding: 16px 20px; font-size: 12px; color: #4b5774; border-top: 1px solid rgba(255,255,255,.06); }
.org-box { margin: auto 12px 14px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.org-box.editable { cursor: pointer; transition: background .15s; }
.org-box.editable:hover { background: rgba(255,255,255,.09); }
.org-name { color: #fff; font-weight: 700; font-size: 13.5px; margin-bottom: 7px; }
.org-line { color: #94a3b8; font-size: 12px; line-height: 1.7; word-break: break-word; }
.org-edit { color: #818cf8; font-size: 11.5px; font-weight: 600; margin-top: 9px; }

.main { flex: 1; margin-left: 248px; min-width: 0; }
.topbar {
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 66px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.topbar h2 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}
.role-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 99px; background: var(--brand-light);
  color: var(--brand-dark); font-weight: 600; letter-spacing: .2px;
}
.burger { display: none; background: none; border: none; font-size: 22px; color: var(--text); }

.content { padding: 28px; max-width: 1320px; }

/* ===== Bandeau d'accueil ===== */
.hero-banner {
  background: var(--brand-grad); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px;
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(99,102,241,.3); position: relative; overflow: hidden;
}
.hero-banner::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.1); top: -90px; right: -40px; }
.hero-text { position: relative; z-index: 1; }
.hero-text h2 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; }
.hero-text p { font-size: 14px; opacity: .9; margin-top: 4px; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-actions .btn.secondary { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.hero-actions .btn.secondary:hover { background: rgba(255,255,255,.28); }
.hero-actions .btn:not(.secondary) { background: #fff; color: var(--brand-dark); box-shadow: none; }
.hero-actions .btn:not(.secondary):hover { background: #f1f5ff; }

/* Disposition tableau de bord */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 22px; }
.dash-side .panel { margin-bottom: 0; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

.quick-step { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 11px; text-decoration: none; color: var(--text); transition: background .12s; }
.quick-step:hover { background: var(--bg); }
.quick-step .qs-num { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-light); color: var(--brand-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-step strong { display: block; font-size: 14px; }
.quick-step small { color: var(--muted); font-size: 12.5px; }

.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recent-item { min-width: 0; }
.recent-thumb { height: 64px; border-radius: 8px; overflow: hidden; background: #0f172a; display: flex; align-items: center; justify-content: center; }
.recent-thumb img, .recent-thumb video { width: 100%; height: 100%; object-fit: cover; }
.recent-thumb .thumb-fill { font-size: 11px; }
.recent-nm { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Composants ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; border: 1px solid var(--border);
  transition: transform .18s, box-shadow .18s; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--brand-grad);
  opacity: 0; transition: opacity .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }
.stat-card .ico {
  width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand); font-size: 22px; flex-shrink: 0;
}
.stat-card .val { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.stat-card .lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; border: 1px solid var(--border); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.panel-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.panel-body { padding: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 10px;
  padding: 10px 17px; font-size: 14px; font-weight: 600; background: var(--brand-grad); color: #fff;
  transition: all .15s; box-shadow: 0 4px 12px rgba(99,102,241,.28); white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,.36); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--bg-2); filter: none; border-color: #c5cdde; }
.btn.danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; box-shadow: none; }
.btn.danger:hover { background: #fee2e2; filter: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(99,102,241,.15); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 12px 18px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); font-weight: 600; }
.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr, .tbl tr { transition: background .12s; }
.tbl tr:hover td { background: var(--bg); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.dot.off { background: #d1d5db; }
.status-txt.on { color: var(--green); font-weight: 600; }
.status-txt.off { color: var(--muted); }

.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--bg-2); color: #475569; font-weight: 500; }

/* Grille écrans */
.screens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.screen-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); transition: transform .18s, box-shadow .18s; }
.screen-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.screen-card .head { padding: 18px 18px 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.screen-card .head h4 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; }
.screen-card .meta { padding: 0 18px 14px; font-size: 13px; color: var(--muted); line-height: 1.75; }
.screen-card .actions { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; background: var(--bg); }

/* Grille médias */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.media-card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); position: relative; border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* Sélection multiple dans « Ajouter du contenu » */
.pick-card { cursor: pointer; }
.pick-card .pick-check {
  position: absolute; top: 8px; left: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 2px solid var(--border-strong); color: transparent;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.pick-card.picked { outline: 3px solid var(--brand); outline-offset: -3px; }
.pick-card.picked .pick-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.media-card .thumb { height: 116px; background: #0f172a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-card .thumb img, .media-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-card .info { padding: 10px 12px; }
.media-card .info .nm { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card .info .sz { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.media-card .del {
  position: absolute; top: 8px; right: 8px; background: rgba(15,23,42,.6); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 8px; font-size: 13px; display: none; backdrop-filter: blur(4px);
}
.media-card:hover .del { display: block; }
.media-card .del:hover { background: var(--red); }

.dropzone {
  border: 2px dashed #c7d2fe; border-radius: var(--radius); padding: 36px; text-align: center;
  color: var(--muted); margin-bottom: 18px; background: linear-gradient(180deg, #fafbff, #f4f5fe); transition: all .15s;
}
.dropzone.over { border-color: var(--brand); background: var(--brand-light); transform: scale(1.005); }

/* Playlist editor */
.pl-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.pl-item .pthumb {
  width: 64px; height: 40px; border-radius: 6px; background: #1f2937; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; flex-shrink: 0;
}
.pl-item .pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-item .pinfo { flex: 1; min-width: 0; }
.pl-item .pinfo .nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .pinfo .tp { font-size: 12px; color: var(--muted); }
.pl-item input.dur { width: 64px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.pl-item select.trans { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.pl-item .mv { display: flex; flex-direction: column; gap: 2px; }
.pl-item .mv button, .pl-item .rm {
  background: var(--bg); border: none; border-radius: 5px; width: 26px; height: 22px; font-size: 12px; color: #374151;
}
.pl-item .rm { height: 46px; color: var(--red); }

/* Jours de la semaine */
.days-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; user-select: none;
}
.day-chip.sel { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

.check-list { max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.check-list label { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 14px; font-weight: normal; }
.pick-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; font-size: 14px; font-weight: normal; border-radius: 8px; }
.pick-row:hover { background: var(--bg); }
.pick-row input { width: auto; }
.pick-sub { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ===== Onglets horizontaux des médias ===== */
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; background: var(--bg-2);
  border-radius: 12px; margin-bottom: 20px;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: none; background: none;
  border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.6); }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }
.tab .tcount { font-size: 11px; background: var(--bg-2); color: var(--muted); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.tab.active .tcount { background: var(--brand-light); color: var(--brand-dark); }

/* ===== Panneau de contrôle des écrans ===== */
.ctrl-group { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.ctrl-title { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 12px; }
.ctrl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ctrl-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text); transition: all .15s; text-align: center;
}
.ctrl-btn span { font-size: 22px; line-height: 1; }
.ctrl-btn:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.ctrl-btn.danger:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }

.shot-box {
  width: 100%; aspect-ratio: 16/9; background: #0f172a; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.shot-box img { width: 100%; height: 100%; object-fit: contain; }
.shot-empty { color: #64748b; font-size: 13px; padding: 16px; text-align: center; }
.shot-time { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(15,23,42,.7); color: #cbd5e1; font-size: 11px; padding: 4px 8px; text-align: center; }

/* Lignes de détails */
.dl-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dl-row:last-child { border-bottom: none; }
.dl-k { color: var(--muted); flex-shrink: 0; }
.dl-v { color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }
.dl-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.dl-log { width: 100%; border-collapse: collapse; font-size: 13px; }
.dl-log th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dl-log td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.dl-log tr:last-child td { border-bottom: none; }

/* ===== Menu déroulant d'ajout de contenu ===== */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16); min-width: 280px; padding: 6px;
  display: none;
}
@media (max-width: 860px) { .menu { right: auto; left: 0; max-width: calc(100vw - 48px); } }
.menu.open { display: block; }
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 11px 14px; border-radius: 7px; font-size: 14px; color: var(--text);
}
.menu-item:hover { background: var(--brand-light); color: var(--brand); }

/* Vignettes des contenus sans fichier */
.thumb-fill { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; }
.thumb-txt { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.3; word-break: break-word; }
.thumb-ticker { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ===== Sections de la bibliothèque (classement par type) ===== */
.lib-section {
  font-size: 14px; font-weight: 700; color: #374151; margin: 22px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.lib-section:first-child { margin-top: 0; }
.lib-count {
  font-size: 11.5px; font-weight: 600; background: var(--brand-light); color: var(--brand);
  padding: 1px 9px; border-radius: 99px;
}

/* ===== Écran d'aperçu en temps réel ===== */
.mf-screen {
  width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px;
  overflow: hidden; position: relative; cursor: pointer;
  border: 1px solid var(--border); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.pv-content { position: absolute; inset: 0; }
.pv-fill {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; text-align: center;
}
.pv-band {
  position: absolute; left: 0; right: 0; overflow: hidden; padding: 2.2% 0; white-space: nowrap;
}
.pv-pos-bottom { bottom: 0; }
.pv-pos-center { top: 50%; transform: translateY(-50%); }
.pv-pos-top { top: 0; }
.pv-band span {
  display: inline-block; font-weight: 700; padding-left: 100%;
  animation: pvScroll linear infinite;
}
@keyframes pvScroll { to { transform: translateX(-100%); } }
.pv-fitbg {
  position: absolute; inset: -4%; width: 108%; height: 108%;
  object-fit: cover; filter: blur(14px) brightness(.55); display: none;
}

/* Case « appliquer à toute la catégorie » */
.apply-all-box { background: var(--brand-light); padding: 13px 14px; border-radius: 10px; }

/* Poignée de glisser-déposer des playlists */
.pl-item .handle {
  cursor: grab; color: #9ca3af; font-size: 17px; user-select: none; padding: 4px 2px;
  flex-shrink: 0;
}
.pl-item .handle:active { cursor: grabbing; }
.pl-item.dragging { opacity: .45; }
.pl-item.drop-target { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--brand-light); }

/* ===== Aperçu des animations ===== */
.anim-stage {
  width: 110px; height: 66px; border-radius: 8px; background: #111827; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.anim-box {
  width: 40px; height: 40px; border-radius: 9px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
}
.a-none { }
.a-fade { animation: kFade .8s ease both; }
.a-slide-left { animation: kSlideLeft .7s ease both; }
.a-slide-right { animation: kSlideRight .7s ease both; }
.a-slide-up { animation: kSlideUp .7s ease both; }
.a-slide-down { animation: kSlideDown .7s ease both; }
.a-zoom-in { animation: kZoomIn .7s ease both; }
.a-zoom-out { animation: kZoomOut .7s ease both; }
.a-rotate { animation: kRotate .8s ease both; }
.a-flip { animation: kFlip .8s ease both; }
.a-bounce { animation: kBounce .9s cubic-bezier(.28,.84,.42,1) both; }
.a-blur { animation: kBlur .9s ease both; }
@keyframes kFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kSlideLeft { from { transform: translateX(160%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kSlideRight { from { transform: translateX(-160%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kSlideUp { from { transform: translateY(160%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kSlideDown { from { transform: translateY(-160%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kZoomIn { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kZoomOut { from { transform: scale(2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kRotate { from { transform: rotate(-180deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kFlip { from { transform: perspective(400px) rotateY(90deg); opacity: 0; } to { transform: perspective(400px) none; opacity: 1; } }
@keyframes kBounce {
  0% { transform: scale(.3); opacity: 0; }
  50% { transform: scale(1.12); opacity: 1; }
  72% { transform: scale(.94); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes kBlur { from { filter: blur(14px); opacity: 0; } to { filter: blur(0); opacity: 1; } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: overlayIn .18s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 540px; max-height: 92vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes modalIn { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.lg { max-width: 780px; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head .x { background: none; border: none; font-size: 20px; color: var(--muted); width: 34px; height: 34px; border-radius: 9px; transition: all .15s; }
.modal-head .x:hover { background: var(--bg-2); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg); }

/* ===== Toast ===== */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: slideup .25s ease;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.split-choice { display: flex; gap: 12px; }
.split-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border: 2px solid var(--border-strong); border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: center; }
.split-card:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.split-card input { display: none; }
.sp-ico { display: flex; gap: 3px; width: 60px; height: 38px; }
.sp-ico .sp-v { flex: 1; background: var(--brand); border-radius: 3px; }
.sp-ico.sp-h { flex-direction: column; }
.sp-ico.sp-h span { flex: 1; background: var(--brand); border-radius: 3px; }
.pl-preview { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.pl-preview .pv-content { position: absolute; inset: 0; }
.pl-preview-cap { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; background: rgba(15,23,42,.7); color: #cbd5e1; font-size: 11px; padding: 4px 8px; text-align: center; }
.connect-box { background: var(--brand-grad); color: #fff; border-radius: 14px; padding: 20px; text-align: center; box-shadow: 0 8px 24px rgba(99,102,241,.3); }
.connect-label { font-size: 13px; opacity: .9; margin-bottom: 8px; }
.connect-code { font-size: 38px; font-weight: 800; letter-spacing: 6px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.connect-box .btn.secondary { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.connect-steps { margin: 18px 0 0 0; padding-left: 22px; color: #475569; font-size: 13.5px; line-height: 1.9; }
.connect-steps li { margin-bottom: 4px; }
.trash-info {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 22px; font-size: 14px; font-weight: 500;
}
.spinner { width: 34px; height: 34px; border: 3px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.empty .big { font-size: 38px; margin-bottom: 10px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .burger { display: block; }
  .content { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
}

/* --- Barre de quota de stockage (Médias) --- */
.storage-box { min-width: 220px; }
.storage-line { font-size: 13px; color: #475569; margin-bottom: 5px; }
.storage-track { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.storage-fill { height: 100%; background: #4f46e5; border-radius: 99px; transition: width .3s; }
.storage-fill.full { background: #dc2626; }

/* --- Section Écrans LED --- */
.led-intro { color: #475569; line-height: 1.6; margin-bottom: 18px; }
.led-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.led-step { display: flex; align-items: flex-start; gap: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; }
.led-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: #4f46e5; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.led-box { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 14px; background: #fff; }
.led-box.info { background: #f5f3ff; border-color: #ddd6fe; }
.led-box-title { font-weight: 700; margin-bottom: 10px; }
.led-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.led-tag { background: #eef2ff; color: #4338ca; font-weight: 600; padding: 6px 12px; border-radius: 99px; font-size: 14px; }
