/* ========================================
   TABLE DES MATIÈRES
   ========================================
   1. Variables & Reset
   2. Layout de base (html, body, main)
   3. Topbar & Navigation
   4. Filtres
   5. Vue Frise (Cards)
   6. Vue Tableau
   7. Vue Timeline
   8. Vue Programmation
   9. Selection Dock
   10. Utilitaires & États
   11. Responsive & Print
   12. Accessibility
   ======================================== */

/* ========================================
   1. VARIABLES & RESET
   ======================================== */
:root {
  /* Spacing */
  --gap: 16px;
  
  /* Colors */
  --bg: #070b10;
  --panel: #0b1118;
  --card: #0d1620;
  --muted: #9fb3c7;
  --text: #eaf3fb;
  --accent: #41d6ff;
  --accent-2: #2aa7d3;
  --stroke: #1a2a3a;
  --yellow: #ffd24d;
  --red: #e11919;
  --green: #1bd97b;
  
  /* Heights */
  --selection-dock-h: 74px;
  --tl-footer-h: 56px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ========================================
   2. LAYOUT DE BASE
   ======================================== */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 18px;
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 18px;
}

section[role="tabpanel"] {
  margin-top: 12px;
}

/* ========================================
   GESTION DE LA VISIBILITÉ DES VUES
   ======================================== */

/* Par défaut, masquer toutes les vues */
#view-frise,
#view-tableau,
#view-timeline,
#view-programmation {
  display: none;
}

/* Afficher uniquement la vue active selon la classe body */
body.view-frise #view-frise {
  display: block;
}

body.view-tableau #view-tableau {
  display: block;
}

body.view-programmation #view-programmation {
  display: block;
}

/* S'assurer que les sections inactives n'interfèrent pas */
section[role="tabpanel"]:not([id]) {
  display: none;
}

/* Masquer les sections qui n'ont pas l'attribut approprié */
body.view-frise section[role="tabpanel"]:not(#view-frise) {
  display: none !important;
}

body.view-tableau section[role="tabpanel"]:not(#view-tableau) {
  display: none !important;
}

body.view-timeline section[role="tabpanel"]:not(#view-timeline) {
  display: none !important;
}

body.view-programmation section[role="tabpanel"]:not(#view-programmation) {
  display: none !important;
}
/* ========================================
   3. TOPBAR & NAVIGATION
   ======================================== */

/* --- Topbar container --- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(7,11,16,.95), rgba(7,11,16,.90));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

body.view-frise #topbar {
  background: linear-gradient(180deg, rgba(7,11,16,.98), rgba(7,11,16,.92));
  backdrop-filter: blur(15px);
}

/* --- Ligne principale : Logo + Tabs + Actions --- */
.topbar-main {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 10px;
}

/* --- Logo --- */
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 45px;
  width: auto;
  display: block;
}

.mark,
h1,
.subtitle {
  display: none;
}

/* --- Tabs au centre --- */
.tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
  margin: 0;
}

.tab {
  background: #0e1f2d;
  border: 1px solid var(--stroke);
  color: #cfe6fb;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  border-color: var(--accent-2);
}

.tab[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(65,214,255,.35);
  color: #fff;
  background: rgba(65,214,255,0.1);
}

/* --- Actions à droite --- */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#ui-toolbar {
  display: none;
}

/* --- Bouton Filtres --- */
.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filters-toggle:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.filters-toggle .arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  line-height: 1;
}

.filters-toggle[aria-expanded="false"] .arrow {
  transform: rotate(-90deg);
}

/* --- Menu Export (dropdown) --- */
.export-dropdown {
  position: relative;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0e1f2d;
  border: 1px solid var(--stroke);
  color: #cfe6fb;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export:hover {
  border-color: var(--accent);
  background: rgba(65,214,255,0.05);
}

.btn-export[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(65,214,255,0.1);
}

.arrow-down {
  font-size: 10px;
  transition: transform 0.2s;
}

.btn-export[aria-expanded="true"] .arrow-down {
  transform: rotate(180deg);
}

.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #0b1118;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.export-menu:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.export-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: #cfe6fb;
  padding: 12px 16px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.export-item:last-child {
  border-bottom: none;
}

.export-item:hover {
  background: rgba(65,214,255,0.1);
  color: var(--accent);
}

/* --- Menu Export Programmation --- */
.export-prog-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.btn-export-prog {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 1px solid #667eea;
  font-weight: 600;
}

.btn-export-prog:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.export-prog-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #0b1118;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1000;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.export-prog-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-prog-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: #cfe6fb;
  padding: 12px 16px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  border-radius: 8px;
  margin: 4px;
}

.export-prog-option:hover {
  background: rgba(65, 214, 255, 0.1);
  color: var(--accent);
}

.export-prog-option:first-child {
  margin-top: 4px;
}

.export-prog-option:last-child {
  margin-bottom: 4px;
}

/* --- Bouton générique --- */
.btn {
  background: #0e1f2d;
  border: 1px solid var(--stroke);
  color: #cfe6fb;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

/* ========================================
   4. FILTRES
   ======================================== */
#ui-filters {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  background: rgba(11,17,24,0.95);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
  padding: 10px;
  backdrop-filter: blur(8px);
}

#ui-filters.collapsed {
  display: none !important;
}

body.view-frise #ui-filters {
  background: rgba(11,17,24,0.98);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0,0,0,.5);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.label {
  font-size: 10px;
  color: #cfe6fb;
  text-transform: uppercase;
  letter-spacing: .35px;
  opacity: .9;
}

.sel,
.txt {
  background: #0e1924;
  color: #eaf3fb;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
}

.txt {
  min-width: 240px;
  flex: 1;
}

.count {
  font-size: 11px;
  color: #9fb3c7;
  margin-left: auto;
}

#btn-clear-filters {
  margin-left: auto;
}

/* --- Genre pills --- */
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 2px;
}

.genre-pill {
  background: #0e1924;
  color: #cfe6fb;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.genre-pill:hover {
  border-color: var(--accent-2);
  background: #0f1a25;
}

.genre-pill:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.genre-pill.active {
  background: var(--accent);
  color: #0b1118;
  border-color: var(--accent);
  font-weight: 600;
}

.genre-pill.active:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

/* --- Filtre Most Wanted --- */
.most-wanted-filter {
  display: flex;
  align-items: center;
  margin-left: 12px;
}

.most-wanted-pill {
  background: #0e1924;
  color: #cfe6fb;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  font-weight: 600;
}

.most-wanted-pill[aria-pressed="false"] {
  color: var(--yellow);
}

.most-wanted-pill:hover {
  border-color: var(--accent-2);
  background: #0f1a25;
}

.most-wanted-pill[aria-pressed="true"] {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  border-color: #ffd700;
}

.most-wanted-pill[aria-pressed="true"]:hover {
  background: linear-gradient(135deg, #ffed4e, #ffd700);
}

/* --- Filter Dropdown (multi-select pour âge) --- */
.filter-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0e1924;
  color: #cfe6fb;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 160px;
  justify-content: space-between;
}

.dropdown-toggle:hover {
  border-color: var(--accent-2);
  background: #0f1a25;
}

.dropdown-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(65,214,255,0.1);
}

.dropdown-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow-down {
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.dropdown-toggle[aria-expanded="true"] .arrow-down {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #0b1118;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 200px;
  z-index: 1000;
  max-height: 400px;
overflow-y: auto;
overflow-x: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.dropdown-menu:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  user-select: none;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(65,214,255,0.1);
}

.dropdown-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--stroke);
  appearance: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.dropdown-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="white" d="M13.5 3.5L6 11 2.5 7.5l1-1L6 9l6.5-6.5z"/></svg>');
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.dropdown-item input[type="checkbox"]:hover {
  border-color: var(--accent);
}

.dropdown-item span {
  font-size: 12px;
  color: #cfe6fb;
}

.dropdown-item:hover span {
  color: var(--accent);
}

/* ========================================
   5. VUE FRISE (CARDS)
   ======================================== */

/* --- Grille --- */
.grid-frise {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding-bottom: 64px;
}

/* --- Card de base --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.32);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
  container-type: inline-size;
  container-name: card;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #2b465f;
}

.card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(65,214,255,.25), 0 8px 22px rgba(65,214,255,.20);
}

/* --- Poster & Overlays --- */
.poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.pill-genre {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  z-index: 2;
}

.pill-most-wanted {
  position: absolute;
  top: 36px;
  left: 8px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.8);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.pill-most-wanted.no-genre {
  top: 8px;
}

.select-box {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10,18,28,.7);
  border: 1px solid #2a3b4f;
  border-radius: 8px;
  padding: 6px;
}

.select-box input {
  width: 16px;
  height: 16px;
}

/* --- Meta block --- */
.meta-block {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 200px;
}

.date-line {
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #cbd8e5;
}

.title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .2px;
  line-height: 1.2;
  margin: 0;
}

.infos {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: #9fb3c7;
}

.cible {
  color: var(--yellow);
}

/* --- Bottom stack (estimations) --- */
.bottom-stack {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.est-heading {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
  text-align: center;
  color: #cfe6fb;
}

.estfr .value {
  font-size: 18px;
  font-weight: 900;
  color: #41d6ff;
  display: block;
  margin-top: 2px;
  text-align: center;
}

.est-sub {
  margin-top: 6px;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .6px;
  text-align: center;
  color: var(--muted);
}

.nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 6px;
  margin-top: 6px;
}

.num {
  background: #0f1925;
  border: 1px solid #203242;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
}

.num .k {
  font-size: 9px;
  color: #9fb3c7;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.num .v {
  font-size: 12px;
  font-weight: 900;
}

/* --- Actions (bande annonce) --- */
.actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
}

.badge-ba {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid transparent;
}

.badge-ba.disabled {
  background: #3a4552;
  color: #cfd9e3;
  cursor: default;
  box-shadow: none;
  pointer-events: none;
  border: 1px solid #566273;
}

/* --- Popover (hover + pin) --- */
.card .popover {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: none;
  background: rgba(10,18,28,.98);
  border: 1px solid #234055;
  border-radius: 14px;
  padding: 12px;
  max-height: 55vh;
  overflow: auto;
  z-index: 5;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}

.card.pop-pinned .popover {
  display: block;
}

.pop-title {
  font-size: 12px;
  font-weight: 400;
  color: #eaf3fb;
  letter-spacing: .2px;
  margin: 0 0 6px 0;
}

.pop-heading {
  font-size: 14px;
  font-weight: 800;
  color: #eaf3fb;
  margin: 10px 0 6px;
}

.syn {
  font-size: 12px;
  line-height: 1.45;
  color: #cfe6fb;
  margin: 4px 0 10px;
}

.popover .ref {
  font-size: 10px;
  color: #ffb347;
  font-weight: 700;
  margin-top: 8px;
}

.pop-close {
  position: sticky;
  top: 0;
  margin: -8px -8px 8px auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #0e1f2d;
  border: 1px solid #2a3b4f;
  color: #cfe6fb;
  cursor: pointer;
}

.pop-close:hover {
  filter: brightness(1.1);
}

/* --- Profile rows (proportions 30/27/15/28) --- */
.profile {
  margin: 10px 0 6px;
}

.p-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0c1723;
  border: 1px solid #223341;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow: hidden;
  min-height: 32px;
}

.p-name {
  flex: 0 0 30%;
  font-size: 11px;
  font-weight: 600;
  color: #cfe6fb;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  min-width: 0;
}

.p-bar {
  flex: 0 0 27%;
  display: flex;
  align-items: center;
}

.p-bar .bar {
  width: 100%;
  height: 8px;
  background: #0e1f2d;
  border: 1px solid #29445a;
  border-radius: 4px;
  overflow: hidden;
}

.p-bar .bar-fill {
  height: 100%;
  background: #41d6ff;
  border-radius: 4px;
}

.pct {
  flex: 0 0 15%;
  font-size: 11px;
  font-weight: 800;
  color: #eaf6ff;
  white-space: nowrap;
  text-align: right;
  overflow: hidden;
}

.idx-wrap {
  flex: 0 0 28%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  min-width: 0;
}

.idx {
  display: block;
  font-size: 11px;
  background: #0e1f2d;
  border: 1px solid #29445a;
  color: #cfe6fb;
  padding: 0px 2px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: auto;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-shrink: 1;
}

.idx.good {
  color: #fff;
  background: #3a6c8e;
  border-color: #5a8cb8;
}

.idx.bad {
  color: #fff;
  background: #8e3a3a;
  border-color: #b85a5a;
}

/* --- Container Queries pour Profile rows --- */
@container card (min-width: 320px) {
  .p-row {
    gap: 8px;
    padding: 8px 12px;
  }
  
  .p-name {
    flex: 0 0 27%;
    font-size: 11px;
  }
  
  .p-bar {
    flex: 0 0 30%;
  }
  
  .p-bar .bar {
    height: 10px;
  }
  
  .pct {
    flex: 0 0 15%;
    font-size: 11px;
  }
  
  .idx-wrap {
    flex: 0 0 28%;
  }
  
  .idx {
    font-size: 10px;
    padding: 1px 3px;
  }
}

@container card (max-width: 319px) and (min-width: 250px) {
  .p-row {
    gap: 6px;
    padding: 6px 8px;
  }
  
  .p-name {
    flex: 0 0 27%;
    font-size: 11px;
  }
  
  .p-bar {
    flex: 0 0 30%;
  }
  
  .p-bar .bar {
    height: 8px;
  }
  
  .pct {
    flex: 0 0 15%;
    font-size: 10px;
  }
  
  .idx-wrap {
    flex: 0 0 28%;
  }
  
  .idx {
    font-size: 10px;
    padding: 1px 2px;
  }
}

@container card (max-width: 249px) and (min-width: 200px) {
  .p-row {
    gap: 4px;
    padding: 6px;
  }
  
  .p-name {
    flex: 0 0 27%;
    font-size: 9px;
    line-height: 1.2;
  }
  
  .p-bar {
    flex: 0 0 30%;
  }
  
  .p-bar .bar {
    height: 7px;
  }
  
  .pct {
    flex: 0 0 15%;
    font-size: 9px;
  }
  
  .idx-wrap {
    flex: 0 0 28%;
  }
  
  .idx {
    font-size: 9px;
    padding: 0px 2px;
  }
}

@container card (max-width: 199px) and (min-width: 150px) {
  .p-row {
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    text-align: center;
    align-items: stretch;
  }
  
  .p-name {
    flex: 0 0 auto;
    font-size: 9px;
    text-align: center;
    white-space: normal;
  }
  
  .p-bar {
    flex: 0 0 auto;
    width: 80%;
    align-self: center;
  }
  
  .p-bar .bar {
    height: 6px;
  }
  
  .pct {
    flex: 0 0 auto;
    font-size: 8px;
    text-align: center;
  }
  
  .idx-wrap {
    flex: 0 0 auto;
    justify-content: center;
    width: 90%;
  }
  
  .idx {
    font-size: 8px;
    padding: 1px 3px;
  }
}

@container card (max-width: 149px) {
  .p-row {
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    text-align: center;
    align-items: stretch;
  }
  
  .p-name {
    flex: 0 0 auto;
    font-size: 8px;
    text-align: center;
    line-height: 1.1;
  }
  
  .p-bar {
    flex: 0 0 auto;
    width: 70%;
    align-self: center;
  }
  
  .p-bar .bar {
    height: 5px;
  }
  
  .pct {
    flex: 0 0 auto;
    font-size: 7px;
    text-align: center;
  }
  
  .idx-wrap {
    flex: 0 0 auto;
    justify-content: center;
    width: 85%;
  }
  
  .idx {
    font-size: 7px;
    padding: 0px 2px;
    border-radius: 4px;
  }
}

/* Fallback pour navigateurs sans Container Queries */
@supports not (container-type: inline-size) {
  .p-name { flex: 0 0 25%; }
  .p-bar { flex: 0 0 25%; }
  .pct { flex: 0 0 15%; }
  .idx-wrap { flex: 0 0 35%; }
}

/* ========================================
   6. VUE TABLEAU
   ======================================== */

/* --- Container & Layout --- */
body.view-tableau main {
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

body.view-tableau .table-wrap {
  max-width: calc(100vw - 24px);
}

.table-wrap {
  padding: 0;
  overflow: auto;
  max-height: calc(100vh - 200px);
  border: none;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  scrollbar-width: auto;
  scrollbar-color: #86868b #f5f5f7;
}

/* --- Scrollbar --- */
.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f5f5f7;
  border-radius: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #86868b;
  border-radius: 6px;
  border: 3px solid #ffffff;
  transition: background 0.2s;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #515154;
}

.table-wrap::-webkit-scrollbar-corner {
  background: #f5f5f7;
  border-radius: 6px;
}

/* --- Table de base --- */
.mv-table--upg {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
  background: #ffffff;
}

/* --- En-têtes --- */
.mv-table--upg thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.mv-table--upg thead th {
  background: #f5f5f7;
  border-bottom: 1px solid #d2d2d7;
  border-right: 1px solid #e5e5e5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #1d1d1f;
  padding: 14px 8px;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
  vertical-align: middle;
}

.mv-table--upg thead th:first-child {
  border-top-left-radius: 12px;
}

.mv-table--upg thead th:last-child {
  border-top-right-radius: 12px;
  border-right: none;
}

/* --- Boutons de tri --- */
.mv-table--upg thead th .th-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  width: 100%;
  justify-content: center;
}

.mv-table--upg thead th .th-btn:hover {
  color: #0071e3;
}

.mv-table--upg thead th .arrow {
  font-size: 9px;
  opacity: 0.6;
}

/* --- Intitulés multi-lignes (S1-S8) --- */
.mv-table--upg thead th .th-label-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  gap: 2px;
}

.mv-table--upg thead th .th-label-split .main {
  font-size: 11px;
  font-weight: 600;
}

.mv-table--upg thead th .th-label-split .sub {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.8;
}

/* --- Largeurs des colonnes --- */
.mv-table--upg .col-tableau-sel {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

.mv-table--upg .col-tableau-poster {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.mv-table--upg .col-tableau-date_sortie {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.mv-table--upg .col-tableau-titre {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.mv-table--upg .col-tableau-genre {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.mv-table--upg .col-tableau-realisateur {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.mv-table--upg .col-tableau-casting {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.mv-table--upg .col-tableau-estimation_entrees_france {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.mv-table--upg [class^="col-tableau-parc-"],
.mv-table--upg [class^="col-tableau-france-"] {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

.mv-table--upg .col-tableau-bande_annonce {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* --- Colonnes sticky --- */
.mv-table--upg .col-tableau-sel,
.mv-table--upg .col-tableau-poster,
.mv-table--upg .col-tableau-date_sortie,
.mv-table--upg .col-tableau-titre {
  position: sticky;
  z-index: 5;
}

.mv-table--upg thead th.col-tableau-sel,
.mv-table--upg thead th.col-tableau-poster,
.mv-table--upg thead th.col-tableau-date_sortie,
.mv-table--upg thead th.col-tableau-titre {
  background: #f5f5f7;
  z-index: 15;
}

.mv-table--upg tbody td.col-tableau-sel,
.mv-table--upg tbody td.col-tableau-poster,
.mv-table--upg tbody td.col-tableau-date_sortie,
.mv-table--upg tbody td.col-tableau-titre {
  background: #ffffff;
}

.mv-table--upg .col-tableau-sel {
  left: 0;
}

.mv-table--upg .col-tableau-poster {
  left: 44px;
}

.mv-table--upg .col-tableau-date_sortie {
  left: 116px;
}

.mv-table--upg .col-tableau-titre {
  left: 236px;
  border-right: 1px solid #d2d2d7 !important;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
}

/* --- Alignement des colonnes --- */
.mv-table--upg .col-tableau-sel,
.mv-table--upg .col-tableau-poster,
.mv-table--upg .col-tableau-date_sortie,
.mv-table--upg .col-tableau-bande_annonce {
  text-align: center;
}

.mv-table--upg .col-tableau-estimation_entrees_france,
.mv-table--upg [class^="col-tableau-parc-"],
.mv-table--upg [class^="col-tableau-france-"] {
  text-align: right;
}

/* --- Styles de contenu --- */
.mv-table--upg .col-tableau-titre .t {
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
  word-wrap: break-word;
}

.mv-table--upg .col-tableau-genre,
.mv-table--upg .col-tableau-realisateur,
.mv-table--upg .col-tableau-casting {
  font-size: 12px;
  line-height: 1.4;
  color: #6e6e73;
  white-space: normal;
  word-wrap: break-word;
}

.mv-table--upg .col-tableau-estimation_entrees_france {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  color: #0071e3;
  white-space: nowrap;
}

.mv-table--upg [class^="col-tableau-parc-"] {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1d1d1f;
  background: #eef6ff;
  white-space: nowrap;
}

.mv-table--upg [class^="col-tableau-france-"] {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: #0071e3;
  font-weight: 500;
  background: #f5f5f7;
  white-space: nowrap;
}

/* --- Bordures séparatrices --- */
.mv-table--upg .col-tableau-poster {
  border-right: none !important;
}

.mv-table--upg .col-tableau-casting,
.mv-table--upg .col-tableau-estimation_entrees_france,
.mv-table--upg .col-tableau-parc-s8 {
  border-right: 2px solid #dcdcdc !important;
}

.mv-table--upg .col-tableau-bande_annonce {
  border-right: none !important;
}

/* --- Cellules du tbody --- */
.mv-table--upg tbody td {
  padding: 14px 8px;
  border-bottom: 1px solid #f2f2f2;
  border-right: 1px solid #e5e5e5;
  vertical-align: middle;
  font-size: 13px;
  color: #1d1d1f;
  background: #ffffff;
  transition: background 0.15s;
}

.mv-table--upg tbody td:last-child {
  border-right: none;
}

/* --- États : Hover --- */
.mv-table--upg tbody tr:hover td {
  background: #fafafa;
}

.mv-table--upg tbody tr:hover td.col-tableau-sel,
.mv-table--upg tbody tr:hover td.col-tableau-poster,
.mv-table--upg tbody tr:hover td.col-tableau-date_sortie,
.mv-table--upg tbody tr:hover td.col-tableau-titre {
  background: #fafafa;
}

.mv-table--upg tbody tr:hover td[class^="col-tableau-parc-"] {
  background: #ddeeff;
}

.mv-table--upg tbody tr:hover td[class^="col-tableau-france-"] {
  background: #ebebeb;
}

/* --- États : Sélection --- */
.mv-table--upg tbody tr[aria-selected="true"] td {
  background: #e8f4fd;
  border-bottom-color: #d0e8f7;
}

.mv-table--upg tbody tr[aria-selected="true"] td.col-tableau-sel,
.mv-table--upg tbody tr[aria-selected="true"] td.col-tableau-poster,
.mv-table--upg tbody tr[aria-selected="true"] td.col-tableau-date_sortie,
.mv-table--upg tbody tr[aria-selected="true"] td.col-tableau-titre,
.mv-table--upg tbody tr[aria-selected="true"] td[class^="col-tableau-parc-"],
.mv-table--upg tbody tr[aria-selected="true"] td[class^="col-tableau-france-"] {
  background: #e8f4fd;
}

/* --- États : Ancienne version --- */
.mv-table--upg tbody tr.is-old td {
  background: #fff5f5 !important;
  color: #1d1d1f !important;
}

.mv-table--upg tbody tr.is-old:hover td {
  background: #ffeded !important;
}

.mv-table--upg tbody tr.is-old .col-tableau-estimation_entrees_france {
  color: #ff3b30 !important;
}

.mv-table--upg tbody tr.is-old [class^="col-tableau-france-"] {
  color: #d4d4d4 !important;
  font-weight: 600;
}

.col-tableau-date_sortie .pill-old {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 12px;
  background: #ff3b30;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- Éléments spéciaux --- */
.thumb {
  width: 54px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto;
}

.mv-table--upg .badge-ba,
.ba.mini {
  display: inline-block;
  padding: 5px 12px;
  background: #0071e3;
  color: #ffffff;
  border-radius: 980px;
  font-weight: 600;
  font-size: 11px;
  text-decoration: none;
  border: none;
  text-align: center;
  transition: background 0.2s;
}

.mv-table--upg .badge-ba:hover,
.ba.mini:hover {
  background: #0077ed;
}

.mv-table--upg .badge-ba.disabled {
  background: #f5f5f7;
  color: #86868b;
  cursor: default;
  pointer-events: none;
}

.col-tableau-sel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #d2d2d7;
  appearance: none;
  cursor: pointer;
  transition: all 0.2s;
}

.col-tableau-sel input[type="checkbox"]:checked {
  background: #0071e3;
  border-color: #0071e3;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="white" d="M13.5 3.5L6 11 2.5 7.5l1-1L6 9l6.5-6.5z"/></svg>');
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.col-tableau-sel input[type="checkbox"]:hover {
  border-color: #0071e3;
}
/* ========================================
   7. VUE TIMELINE - Style inspiré du tableau
   ======================================== */

body.view-timeline main {
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

body.view-timeline #view-timeline {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  overflow: hidden;
}

/* Container de la table avec scroll - Style tableau */
.tlwrap {
  flex: 1;
  overflow: auto;
  border: none;
  border-radius: 16px;
  margin: 0;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  scrollbar-width: auto;
  scrollbar-color: #86868b #f5f5f7;
}

/* Scrollbar - Style tableau */
.tlwrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.tlwrap::-webkit-scrollbar-track {
  background: #f5f5f7;
  border-radius: 6px;
}

.tlwrap::-webkit-scrollbar-thumb {
  background: #86868b;
  border-radius: 6px;
  border: 3px solid #ffffff;
  transition: background 0.2s;
}

.tlwrap::-webkit-scrollbar-thumb:hover {
  background: #515154;
}

.tlwrap::-webkit-scrollbar-corner {
  background: #f5f5f7;
  border-radius: 6px;
}

/* Table */
.tl-grid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
  width: 100%;
  background: #ffffff;
}

/* HEADER STICKY - Style tableau */
.tl-grid thead {
  position: sticky;
  top: 0;
  z-index: 15;
}

.tl-grid thead th {
  background: #f5f5f7;
  border-bottom: 1px solid #d2d2d7;
  border-right: 1px solid #e5e5e5;
  text-align: center;
  padding: 14px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #1d1d1f;
  white-space: normal;
  line-height: 1.3;
  vertical-align: middle;
}

.tl-grid thead th:first-child {
  border-top-left-radius: 12px;
}

.tl-grid thead th:last-child {
  border-top-right-radius: 12px;
  border-right: none;
}

.tl-grid thead th .wk {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 2px;
}

.tl-grid thead th .wk .w1 {
  font-weight: 600;
  font-size: 11px;
}

.tl-grid thead th .wk .w2 {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.8;
}

.tl-grid thead th .th {
  padding: 0;
  font-weight: 600;
  font-size: 11px;
}

/* Colonnes sticky gauche - Style tableau */
.stickL {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 10;
}

.tl-grid thead th.stickL {
  background: #f5f5f7;
  z-index: 16;
}

.col-timeline-film {
  left: 0;
  min-width: 260px;
  max-width: 260px;
}

.col-timeline-date {
  left: 260px;
  min-width: 140px;
  max-width: 140px;
  text-align: center;
  background: #ffffff;
  font-size: 13px;
  color: #1d1d1f;
  border-right: 1px solid #d2d2d7 !important;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
}

.tl-grid thead th.col-timeline-date {
  background: #f5f5f7;
}

/* Cellules body - Style tableau */
.tl-grid tbody td,
.tl-grid tbody th {
  padding: 14px 8px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #f2f2f2;
  background: #ffffff;
  font-size: 13px;
  color: #1d1d1f;
  transition: background 0.15s;
  vertical-align: middle;
}

.tl-grid tbody td:last-child {
  border-right: none;
}

/* Suppression de l'alternance de couleur */
.tl-grid tbody tr:nth-child(even) td,
.tl-grid tbody tr:nth-child(even) th.stickL {
  background: #ffffff;
}

/* Hover state - Style tableau */
.tl-grid tbody tr:hover td,
.tl-grid tbody tr:hover th {
  background: #fafafa;
}

.tl-grid td.hit {
  cursor: pointer;
  text-align: center;
}

.tl-grid td.hit .n {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 980px;
  background: #0071e3;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.2s;
}

.tl-grid td.hit .n:hover {
  background: #0077ed;
}

.tl-grid td.hit.on {
  background: #eef6ff;
}

.tl-grid tbody tr:hover td.hit.on {
  background: #ddeeff;
}

/* FOOTER STICKY - Style tableau */
.tl-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  background: #f5f5f7;
  padding: 12px;
  border-top: 1px solid #d2d2d7;
  margin-top: auto;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  color: #1d1d1f;
}

.tl-footer .tl-reset {
  margin-left: 10px;
  padding: 6px 14px;
  border-radius: 980px;
  background: #0071e3;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: background 0.2s;
}

.tl-footer .tl-reset:hover {
  background: #0077ed;
}

/* Titre timeline - Style tableau */
.tl-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #dedee2;
  text-align: center;
  display: block;
  width: 100%;
}
/* ========================================
   8. VUE PROGRAMMATION
   ======================================== */

/* --- Layout général --- */
body.view-programmation main {
  max-width: 100%;
  padding: 0;
}

body.view-programmation #topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}

.programmation-container {
  background: #fafafa;
  padding: 20px;
  min-height: 100vh;
}

.prog-page {
  width: 297mm;
  height: 210mm;
  background: white;
  margin: 30px auto;
  position: relative;
  overflow: hidden;
  page-break-after: always;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  border-radius: 3px;
}

/* --- Page de couverture --- */
.prog-cover {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 60px;
}

.prog-cover h1 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  opacity: 0.6;
  text-transform: uppercase;
}

.prog-cover .year {
  font-size: 180px;
  font-weight: 700;
  letter-spacing: -8px;
  background: linear-gradient(135deg, #ffffff 0%, #999999 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prog-cover .logo {
  position: absolute;
  bottom: 60px;
  right: 80px;
  font-size: 24px;
  font-weight: 300;
  opacity: 0.4;
  letter-spacing: 2px;
}

/* --- Page de mois --- */
.prog-month {
  background: #fafafa;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.prog-month h2 {
  color: #000;
  font-size: 120px;
  font-weight: 300;
  letter-spacing: -4px;
}

.prog-month .logo {
  position: absolute;
  bottom: 60px;
  right: 80px;
  font-size: 18px;
  font-weight: 300;
  opacity: 0.3;
  letter-spacing: 2px;
}

/* --- Page de film --- */
.prog-film {
  display: grid;
  grid-template-columns: 45% 55%;
  background: white;
}

.film-left {
  position: relative;
  overflow: hidden;
  background: #f5f5f7;
}

.film-left .film-poster-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
}

.film-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent 50%);
  z-index: 2;
  pointer-events: none;
}

.film-right {
  padding: 45px 50px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

/* --- En-tête du film --- */
.film-header {
  margin-bottom: 25px;
}

.film-meta-line {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.meta-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-date {
  background: #000;
  color: white;
}

.badge-target {
  background: #f5f5f7;
  color: #1d1d1f;
}

.badge-genre {
  background: transparent;
  border: 1.5px solid #d2d2d7;
  color: #6e6e73;
}

.film-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: #1d1d1f;
  margin-bottom: 8px;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Tailles adaptatives du titre --- */
.film-title.size-1 { font-size: 42px; letter-spacing: -1.5px; }
.film-title.size-2 { font-size: 36px; letter-spacing: -1.2px; }
.film-title.size-3 { font-size: 30px; letter-spacing: -1px; }
.film-title.size-4 { font-size: 26px; letter-spacing: -0.8px; }
.film-title.size-5 { font-size: 22px; letter-spacing: -0.5px; }
.film-title.size-6 { font-size: 19px; letter-spacing: -0.3px; }
.film-title.size-7 { font-size: 16px; letter-spacing: -0.2px; }

/* --- Casting & Info --- */
.casting-info-section {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 25px;
  margin-bottom: 20px;
  align-items: start;
}

.casting-column,
.info-column {
  display: flex;
  flex-direction: column;
}

.casting-block,
.info-block {
  display: flex;
  flex-direction: column;
}

/* --- Grille de 3 acteurs --- */
.casting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.actor-card {
  text-align: center;
}

.actor-photo {
  width: 100%;
  aspect-ratio: 2/3;
  background: #f5f5f7;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.actor-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.actor-name {
  font-size: 9px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* --- Infos techniques --- */
.info-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label-inline {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e6e73;
  margin-bottom: 4px;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
}

/* --- Synopsis --- */
.synopsis-section {
  margin-bottom: 25px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6e6e73;
  margin-bottom: 12px;
}

.synopsis-text {
  font-size: 14px;
  line-height: 1.6;
  color: #1d1d1f;
  font-weight: 400;
}

/* --- Footer du film (TOP 3 + Entrées) --- */
.film-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
  align-items: stretch;
  width: 100%;
}

.film-footer > * {
  min-width: 0;
}

/* --- TOP 3 CIBLES --- */
.profile-section {
  display: flex;
  flex-direction: column;
}

.film-footer .profile-chips {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  align-items: stretch;
}

.film-footer .profile-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 64px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--chip-bg, #f5f5f5);
}

.film-footer .chip-label {
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: normal;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  color: #1d1d1f;
}

.chip-value {
  font-size: 20px;
  font-weight: 700;
  color: #1d1d1f;
}

.profile-ref {
  font-size: 10px;
  color: #86868b;
  margin-top: 10px;
  font-style: italic;
}

/* --- ENTRÉES FRANCE --- */
.estimation-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.film-footer .estimation-section :is(h3, h4, h5, .title) {
  white-space: nowrap;
  font-weight: 600;
  font-size: clamp(12px, 0.95em, 14px);
  margin-bottom: 4px;
}

.estimation-number {
  font-size: 48px;
  font-weight: 800;
  color: #000;
  letter-spacing: -2px;
  line-height: 1;
  margin-top: 12px;
  white-space: nowrap;
}

.film-footer .estimation-number {
  line-height: 1.1;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
}

.estimation-note {
  font-size: 9px;
  color: #86868b;
  text-align: right;
  margin-top: 10px;
  line-height: 1.4;
}

/* --- Lien bande-annonce --- */
.trailer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #000;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}

.trailer-link:hover {
  background: #333;
  transform: translateX(2px);
}

.trailer-link::before {
  content: '▶';
  font-size: 10px;
}

/* ========================================
   9. SELECTION DOCK
   ======================================== */
.selection-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: linear-gradient(180deg, rgba(11,17,24,.92), rgba(11,17,24,.98));
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  min-height: var(--selection-dock-h);
}

.selection-dock__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
}

.selection-dock strong {
  color: var(--text);
}

.selection-dock .btn {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
  cursor: pointer;
}

.selection-dock .btn:hover {
  border-color: var(--accent);
}

.selection-dock .btn.danger {
  background: #1a1010;
  border-color: #5a2020;
  color: #ffd9d9;
}

/* --- Liste des films sélectionnés --- */
.selected-films-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  max-height: 50px;
  overflow-y: auto;
  padding-right: 4px;
}

.selected-film-tag {
  background: var(--accent);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255,255,255,0.1);
}

/* --- Scrollbar pour la liste --- */
.selected-films-list::-webkit-scrollbar {
  width: 4px;
}

.selected-films-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

.selected-films-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

/* ========================================
   10. UTILITAIRES & ÉTATS
   ======================================== */

/* --- États de visibilité --- */
#btn-clear,
#sel-count,
.selection-hud,
[data-role="selection-hud"] {
  display: none !important;
}

/* --- Mode export --- */
body.export {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  background: #fff;
  color: #111;
}

body.export .fiche {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 16px;
}

body.export .fiche h2 {
  margin: 0 0 6px 0;
  font-size: 18px;
}

body.export .fiche .meta {
  color: #666;
  font-size: 13px;
  margin: 0 0 8px 0;
}

/* --- État has-selection --- */
body.has-selection {
  /* Réservé pour les ajustements globaux */
}

body.view-frise main {
  padding-top: 20px;
}

/* ========================================
   11. RESPONSIVE & PRINT
   ======================================== */

/* --- Responsive Topbar --- */
@media (max-width: 1200px) {
  .topbar-main {
    gap: 16px;
  }
  
  .tabs {
    gap: 6px;
  }
  
  .tab {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .topbar-main {
    flex-wrap: wrap;
  }
  
  .tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

/* --- Responsive Frise Grid --- */
@media (max-width: 1400px) {
  .grid-frise {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .grid-frise {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .grid-frise {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .grid-frise {
    grid-template-columns: 1fr;
  }
}

/* --- Responsive Tableau --- */
@media (max-width: 820px) {
  .mv-table--upg {
    min-width: 860px;
  }
}

/* --- Responsive Filtres --- */
@media (max-width: 600px) {
  .genre-pills {
    min-height: auto;
  }
  
  .genre-pill {
    font-size: 10px;
    padding: 5px 10px;
  }
  
  .selected-film-tag {
    font-size: 10px;
    padding: 3px 6px;
    max-width: 120px;
  }
  
  .selected-films-list {
    gap: 4px;
    max-height: 40px;
  }
}

/* --- Fallback Profile rows (sans Container Queries) --- */
@supports not (container-type: inline-size) {
  @media (max-width: 1400px) {
    .p-name { font-size: 10px; }
    .p-bar .bar { height: 8px; }
    .idx { font-size: 8px; }
  }
  
  @media (max-width: 1200px) {
    .p-name { font-size: 10px; }
    .p-bar .bar { height: 8px; }
    .pct { font-size: 9px; }
    .idx { font-size: 8px; }
  }
  
  @media (max-width: 860px) {
    .p-name { font-size: 9px; }
    .p-bar .bar { height: 7px; }
    .pct { font-size: 8px; }
    .idx { font-size: 7px; }
  }
  
  @media (max-width: 540px) {
    .p-row {
      flex-direction: column;
      gap: 4px;
      text-align: center;
      align-items: stretch;
    }
    
    .p-name,
    .pct,
    .idx-wrap {
      flex: 0 0 auto;
      text-align: center;
    }
    
    .p-bar {
      flex: 0 0 auto;
      width: 80%;
      align-self: center;
    }
    
    .idx-wrap {
      justify-content: center;
      width: 90%;
    }
  }
}

/* --- Print --- */
@media print {
  body {
    background: white;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  
  .prog-page {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    page-break-after: always;
  }
  
  /* Affiches de films */
  .film-left,
  .film-left .film-poster-img {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  
  /* Désactiver le gradient overlay lors de l'impression */
  .film-left::after {
    display: none !important;
  }
  
  #topbar,
  #selection-dock,
  .selection-dock {
    display: none !important;
  }
  
  .programmation-container {
    padding: 0;
  }
}

/* ========================================
   12. ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   PROTECTION PAR MOT DE PASSE
   ======================================== */

#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

#login-overlay.hidden {
  display: none;
}

/* Logo Mediavision en grand */
.login-overlay-logo {
  width: 90%;
  max-width: 800px;
  height: auto;
  margin-bottom: 60px;
  opacity: 0.95;
  animation: fadeInLogo 0.8s ease-out;
}

@keyframes fadeInLogo {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 0.95;
    transform: translateY(0);
  }
}

.login-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: fadeInBox 0.8s ease-out 0.3s both;
}

@keyframes fadeInBox {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box h2 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 20px;
  box-sizing: border-box;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: all 0.3s;
}

.login-box input[type="password"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.login-box input[type="password"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.login-box button {
  width: 100%;
  padding: 16px 20px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.login-box button:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.login-box button:active {
  transform: translateY(0);
}

.login-box .error {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 16px;
  display: none;
  font-weight: 500;
  animation: shake 0.5s;
}

.login-box .error.show {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

body.locked #main-content {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .login-overlay-logo {
    width: 85%;
    margin-bottom: 40px;
  }
  
  .login-box {
    padding: 30px 20px;
    max-width: 90%;
  }
}
/* ========================================
   FIN DU FICHIER
   ======================================== */
