/* ============================================================
   PlexDL — thème inspiré de Plex (sombre, accent orange #e5a00d)
   ============================================================ */
:root {
  --bg: #0d0d0d;
  --bg-soft: #141414;
  --panel: #1b1b1b;
  --panel-2: #232323;
  --panel-3: #2b2b2b;
  --line: #303030;
  --text: #f3f3f3;
  --text-dim: #b9b9b9;
  --muted: #8d8d8d;
  --accent: #e5a00d;
  --accent-hi: #ffb927;
  --accent-ink: #161200;
  --danger: #e5484d;
  --ok: #3fbf6f;
  --info: #4aa8ff;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar: 236px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; }
svg.ico { width: 18px; height: 18px; flex: none; }
::selection { background: var(--accent); color: #111; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- boot ---------- */
.boot-screen { display: grid; place-items: center; gap: 18px; height: 100vh; }
.boot-logo { font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: var(--accent); }
.boot-spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #333; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.root { min-height: 100vh; }
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #101010, #0a0a0a);
  border-right: 1px solid #1e1e1e;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--accent-hi), #c07f00);
  display: grid; place-items: center; color: #1a1400; font-weight: 900; font-size: 15px;
  box-shadow: 0 4px 14px rgba(229, 160, 13, .35);
}
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.brand-text small { display: block; font-weight: 500; font-size: 10.5px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }

.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: #6f6f6f; padding: 16px 12px 6px; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px; color: var(--text-dim); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: #1c1c1c; color: var(--text); }
.nav a.active { background: #232323; color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav a .ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); background: #262626; padding: 1px 7px; border-radius: 20px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #1c1c1c; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(13, 13, 13, .82);
  backdrop-filter: blur(14px); border-bottom: 1px solid #1c1c1c;
}
.search { position: relative; flex: 1; max-width: 520px; }
.search input {
  width: 100%; padding: 10px 14px 10px 40px; border-radius: 9px;
  background: #1b1b1b; border: 1px solid #2a2a2a; color: var(--text); outline: none;
  transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--accent); background: #202020; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.topbar-spacer { flex: 1; }
.chip-user {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
  background: #1b1b1b; border: 1px solid #2a2a2a; border-radius: 100px; color: var(--text-dim);
  cursor: pointer; font-size: 13.5px;
}
.chip-user:hover { border-color: #3a3a3a; color: var(--text); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(145deg, var(--accent), #8a5f00); color: #191300; display: grid; place-items: center; font-weight: 800; font-size: 12px; text-transform: uppercase; }

.view { padding: 22px 28px 90px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  background: #262626; color: var(--text); font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: #303030; }
.btn:active { transform: scale(.985); }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: transparent; border-color: #3a3a3a; color: var(--text-dim); }
.btn-ghost:hover { background: #1e1e1e; color: var(--text); border-color: #4a4a4a; }
.btn-danger { background: rgba(229, 72, 77, .14); color: #ff8b8e; border-color: rgba(229, 72, 77, .35); }
.btn-danger:hover { background: rgba(229, 72, 77, .24); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 380px; display: flex; align-items: flex-end;
  margin-bottom: 34px; box-shadow: var(--shadow); isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(13,13,13,.96) 8%, rgba(13,13,13,.72) 45%, rgba(13,13,13,.25) 100%),
              linear-gradient(0deg, #0d0d0d 2%, transparent 55%);
}
.hero-inner { padding: 40px; max-width: 620px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); font-weight: 800; margin-bottom: 10px; }
.hero-kicker svg.ico { width: 13px; height: 13px; }
.hero h1 { font-size: clamp(26px, 3.4vw, 44px); margin: 0 0 10px; line-height: 1.08; letter-spacing: -1px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 12px; }
.hero p { color: var(--text-dim); margin: 0 0 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- sections / grille ---------- */
.section { margin-bottom: 38px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 19px; margin: 0; letter-spacing: -.3px; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.section-head .spacer { flex: 1; }
.section-head a.more { color: var(--accent); font-size: 13px; font-weight: 600; }

.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 16px; overflow-x: auto;
  padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 64px), rgba(0,0,0,.25) 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 64px), rgba(0,0,0,.25) 100%);
}
.row-scroll.at-end, .row-scroll.no-overflow { -webkit-mask-image: none; mask-image: none; }
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll > * { scroll-snap-align: start; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 20px 16px; }
.tile { min-width: 0; }

.poster { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: #1c1c1c; aspect-ratio: 2 / 3; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .18s ease, box-shadow .18s ease; }
.poster:hover { transform: translateY(-3px) scale(1.015); box-shadow: 0 14px 28px rgba(0,0,0,.55); z-index: 2; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .ph { display: grid; place-items: center; height: 100%; color: #4a4a4a; font-size: 30px; }
.poster-overlay {
  position: absolute; inset: 0; padding: 10px; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.35) 44%, transparent 72%);
  opacity: 0; transition: opacity .18s;
}
.poster:hover .poster-overlay, .poster:focus-within .poster-overlay { opacity: 1; }
.poster-title { font-size: 13px; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.poster-sub { font-size: 11.5px; color: var(--text-dim); margin-bottom: 9px; }
.poster-actions { display: flex; gap: 6px; }
.poster-actions .btn { padding: 7px; border-radius: 7px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.poster-actions .btn:hover { background: var(--accent); color: #111; }
.poster-badge { position: absolute; top: 8px; right: 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.55); color: #e9e9e9; text-transform: uppercase; opacity: 0; transition: opacity .18s; }
.poster:hover .poster-badge { opacity: 1; }
.poster-badge.hevc { color: #9ad0ff; }
.poster-count {
  position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 100px; background: rgba(10,10,10,.86); color: #fff;
  border: 1px solid rgba(255,255,255,.18); text-shadow: 0 1px 2px rgba(0,0,0,.9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.poster-caption { margin-top: 9px; }
.poster-caption .t { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-caption .s { font-size: 11.5px; color: var(--muted); }

/* ---------- filtres ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.select, .input {
  background: #1b1b1b; color: var(--text); border: 1px solid #2d2d2d; border-radius: 8px;
  padding: 9px 12px; outline: none; font-size: 13.5px;
}
.input:focus, .select:focus { border-color: var(--accent); }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: #1b1b1b; border: 1px solid #2d2d2d; border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; color: var(--text-dim); padding: 6px 13px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button.active { background: #303030; color: var(--text); }

/* ---------- détail ---------- */
.detail-hero { position: relative; isolation: isolate; margin: -22px -28px 0; padding: 90px 28px 34px; overflow: hidden; }
.detail-hero .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 20%; opacity: .38; filter: saturate(.9); }
.detail-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--bg) 0%, rgba(13,13,13,.86) 42%, rgba(13,13,13,.55) 100%); }
.detail-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.detail-poster { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2/3; background: #1b1b1b; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-body h1 { font-size: clamp(24px, 3vw, 38px); margin: 0 0 8px; letter-spacing: -1px; line-height: 1.1; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--text-dim); font-size: 13.5px; align-items: center; margin-bottom: 14px; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: #555; }
.rating-badge { border: 1px solid #4a4a4a; border-radius: 6px; padding: 0 7px; font-weight: 700; font-size: 12px; color: #ddd; }
.badge-r { background: #6a6a6a; color: #fff; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #232323; border: 1px solid #333; color: var(--text-dim); font-size: 12px; padding: 4px 9px; border-radius: 100px; }
.pill.ok { color: #9be6b4; border-color: rgba(63,191,111,.4); background: rgba(63,191,111,.1); }
.pill.warn { color: #ffd08a; border-color: rgba(229,160,13,.4); background: rgba(229,160,13,.1); }
.pill.bad { color: #ff9ea1; border-color: rgba(229,72,77,.4); background: rgba(229,72,77,.1); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.synopsis { color: #cfcfcf; max-width: 820px; line-height: 1.65; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 26px; max-width: 900px; }
.fact { background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 12px 14px; }
.fact.fact-full { grid-column: 1 / -1; }
.fact .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #7e7e7e; font-weight: 700; }
.fact .v { font-size: 14px; margin-top: 3px; color: #e6e6e6; }

/* ---------- saisons / épisodes ---------- */
.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 18px; }
.season-tabs button { background: #1b1b1b; border: 1px solid #2c2c2c; color: var(--text-dim); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.season-tabs button.active { background: var(--accent); border-color: var(--accent); color: #171200; }
.ep-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.ep-head h3 { margin: 0; font-size: 16px; }
.ep-head .spacer { flex: 1; }
.ep-list { display: flex; flex-direction: column; gap: 8px; }
.ep {
  display: grid; grid-template-columns: 28px 132px 1fr auto; gap: 14px; align-items: center;
  background: #161616; border: 1px solid #232323; border-radius: 10px; padding: 10px 14px;
  transition: background .15s, border-color .15s;
}
.ep:hover { background: #1c1c1c; border-color: #303030; }
.ep-num { color: #7c7c7c; font-weight: 700; font-size: 13px; text-align: center; }
.ep-thumb { width: 132px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #222; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-main { min-width: 0; }
.ep-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.ep-actions { display: flex; gap: 6px; align-items: center; }
.ep-check { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- lecteur ---------- */
.player-view { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; }
.player-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; background: linear-gradient(180deg, rgba(0,0,0,.92), transparent); position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
.player-top .t { font-weight: 700; }
.player-top .s { color: var(--text-dim); font-size: 12.5px; }
.player-top .spacer { flex: 1; }
.player-stage { flex: 1; display: grid; place-items: center; min-height: 0; }
.player-stage video { width: 100%; height: 100%; max-height: 100vh; background: #000; }
.player-fallback { max-width: 640px; text-align: center; padding: 30px; }
.player-fallback h2 { margin: 0 0 10px; }
.player-fallback p { color: var(--text-dim); margin: 0 0 20px; }
.player-next { position: absolute; right: 20px; bottom: 20px; z-index: 3; }

/* ---------- tableaux admin ---------- */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid #242424; margin-bottom: 22px; flex-wrap: wrap; }
.admin-tabs button { background: transparent; border: 0; color: var(--text-dim); padding: 11px 14px; cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; font-size: 13.5px; }
.admin-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: linear-gradient(160deg, #1b1b1b, #151515); border: 1px solid #262626; border-radius: 12px; padding: 16px 18px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #7d7d7d; font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--muted); }
.panel { background: #151515; border: 1px solid #242424; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 15.5px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: #7e7e7e; padding: 8px 10px; border-bottom: 1px solid #262626; font-weight: 700; }
.table td { padding: 10px; border-bottom: 1px solid #1f1f1f; vertical-align: middle; }
.table tr:hover td { background: #191919; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #262626; color: #bbb; }
.tag.ok { background: rgba(63,191,111,.14); color: #8fe0ae; }
.tag.warn { background: rgba(229,160,13,.14); color: #ffcf87; }
.tag.bad { background: rgba(229,72,77,.16); color: #ff9ea1; }
.tag.info { background: rgba(74,168,255,.14); color: #9ecbff; }

/* formulaires */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.field input, .field select, .field textarea {
  background: #1b1b1b; border: 1px solid #2e2e2e; border-radius: 8px; color: var(--text);
  padding: 9px 12px; outline: none; font-size: 13.5px; font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-dim); }
.switch input { width: 38px; height: 21px; appearance: none; background: #333; border-radius: 20px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #bbb; transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); background: #1b1400; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- modales ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal { background: #171717; border: 1px solid #2b2b2b; border-radius: 14px; width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { width: min(960px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #262626; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #262626; display: flex; gap: 10px; justify-content: flex-end; }
.picker-list { display: grid; gap: 6px; max-height: 380px; overflow: auto; margin-top: 12px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid #242424; background: #141414; cursor: pointer; font-size: 13px; }
.picker-item:hover { border-color: #3a3a3a; background: #1b1b1b; }
.picker-item input { accent-color: var(--accent); width: 16px; height: 16px; }
.picker-item .y { color: var(--muted); font-size: 12px; }

/* ---------- toasts & downloads ---------- */
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #202020; border: 1px solid #333; color: var(--text); padding: 11px 18px; border-radius: 100px; font-size: 13.5px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: rise .22s ease; pointer-events: auto; }
.toast.err { border-color: rgba(229,72,77,.55); color: #ffb3b5; }
.toast.ok { border-color: rgba(63,191,111,.45); color: #b6f0c9; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.dl-panel { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 320px; background: #171717; border: 1px solid #2c2c2c; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.dl-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #1e1e1e; border-bottom: 1px solid #2a2a2a; font-weight: 700; font-size: 13.5px; }
.dl-head .spacer { flex: 1; }
.dl-body { max-height: 240px; overflow: auto; padding: 8px; }
.dl-item { display: flex; gap: 9px; align-items: center; padding: 7px 8px; font-size: 12.5px; color: var(--text-dim); border-radius: 7px; }
.dl-item:hover { background: #1e1e1e; }
.dl-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-item .st { font-size: 11px; color: var(--muted); }
.dl-item.done .st { color: var(--ok); }

/* ---------- connexion ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-art { position: relative; overflow: hidden; background: #0a0a0a; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 30% 40%, rgba(229,160,13,.14), transparent 70%), linear-gradient(0deg, #0d0d0d, transparent 60%); }
.auth-grid { position: absolute; inset: -10%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; opacity: .35; transform: rotate(-8deg) scale(1.1); }
.auth-grid div { aspect-ratio: 2/3; border-radius: 10px; background-size: cover; background-position: center; }
.auth-side { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.auth-card { width: min(400px, 100%); }
.auth-card .brand { padding: 0 0 26px; }
.auth-card h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.5px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.login-error { background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); color: #ffb3b5; padding: 10px 13px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; line-height: 1.4; }
.auth-note { margin-top: 20px; font-size: 12px; color: #6f6f6f; }

/* ---------- divers ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .6; }
.skeleton { background: linear-gradient(90deg, #1b1b1b 25%, #222 37%, #1b1b1b 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; }
.hr { height: 1px; background: #242424; margin: 26px 0; border: 0; }
.share-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: rgba(229,160,13,.08); border: 1px solid rgba(229,160,13,.28); color: #ffd89a; padding: 10px 16px; border-radius: 10px; margin-bottom: 22px; font-size: 13px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 62px; flex-direction: row; align-items: center; padding: 0 8px; border-right: 0; border-top: 1px solid #222; overflow-x: auto; z-index: 40; }
  .sidebar .brand, .sidebar .nav-label, .sidebar-foot { display: none; }
  .nav { flex-direction: row; gap: 2px; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 8px 10px; flex: 1; justify-content: center; }
  .nav a .count { display: none; }
  .nav a.active { box-shadow: inset 0 2px 0 var(--accent); }
  .view { padding: 16px 16px 90px; }
  .topbar { padding: 10px 16px; }
  .detail-hero { margin: -16px -16px 0; padding: 40px 16px 24px; }
  .detail-inner { grid-template-columns: 130px 1fr; gap: 18px; }
  .hero { min-height: 300px; }
  .hero-inner { padding: 22px; }
  .ep { grid-template-columns: 22px 1fr auto; }
  .ep-thumb { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px 10px; }
  .row-scroll { grid-auto-columns: 132px; }
  .detail-inner { grid-template-columns: 1fr; }
  .detail-poster { width: 150px; }
  .poster-actions { flex-wrap: wrap; }
}
