/* ============================================
   CANNES 2026 — BIBLE NUMÉRIQUE
   Mobile-first styles
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d1a;
  --bg-card:   #161628;
  --bg-card2:  #1e1e38;
  --bg-input:  #1a1a30;
  --text:      #f0f0f0;
  --text-muted:#7a7a9a;
  --text-dim:  #4a4a6a;
  --gold:      #d4a843;
  --gold-dim:  #7a5a1a;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --danger:    #e85555;
  --success:   #5ec97a;
  --nav-h:     68px;
  --header-h:  54px;
  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
button { color: inherit; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ---- HEADER ---- */
#app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--header-h);
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  padding-top: env(safe-area-inset-top);
  z-index: 200;
}

.header-logo { display: flex; align-items: center; gap: 8px; flex: 1; }
.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.logo-cannes {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}
.logo-cannes-accent { color: var(--gold); }
.logo-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

#btn-lang {
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s;
}
#btn-lang:active { opacity: 0.7; }

/* ---- SYNC DOT ---- */
.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  transition: background 0.3s;
  flex-shrink: 0;
}
.sync-idle   { background: transparent; }
.sync-syncing { background: var(--gold); animation: pulse 0.8s infinite alternate; }
.sync-ok     { background: #4caf7d; }
.sync-error  { background: #e05c5c; }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }

/* ---- MAIN VIEW ---- */
#main-view {
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  min-height: 100vh;
}

/* ---- BOTTOM NAV ---- */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(22,22,40,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  z-index: 200;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
  min-height: 60px;
}
.nav-item.active { color: var(--gold); }
.nav-item:active { opacity: 0.6; }
.nav-icon { font-size: 1.35rem; line-height: 1; display: block; }
.add-icon { font-size: 1.6rem; font-weight: 300; line-height: 1; }
.nav-label { font-size: 0.62rem; font-weight: 500; letter-spacing: 0.04em; }

/* ---- SHARED COMPONENTS ---- */

.page-header {
  padding: 20px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  flex: 1;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.7; }
.btn-primary { background: var(--gold); color: #0d0d1a; }
.btn-secondary { background: var(--bg-card2); color: var(--text); border: 1px solid var(--border2); }
.btn-danger { background: rgba(232,85,85,0.15); color: var(--danger); border: 1px solid rgba(232,85,85,0.3); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 0 18px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 18px 8px;
}

/* ---- DATE NAV ---- */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 0 18px 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.date-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 10px;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}
.date-nav-btn:active { background: var(--bg-card2); }
.date-nav-center {
  text-align: center;
  flex: 1;
}
.date-nav-day {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.date-nav-full {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-top: 1px;
}
.date-today-badge {
  display: inline-block;
  background: var(--gold);
  color: #0d0d1a;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ---- EVENT CARDS ---- */
.events-list {
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  display: flex;
  position: relative;
}
.event-card:active { background: var(--bg-card2); }

.event-film-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: 0;
}

.event-card-inner {
  padding: 12px 14px;
  flex: 1;
  min-width: 0;
}

.event-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.event-time {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.event-time-end {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.event-tbc {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-card2);
  padding: 2px 7px;
  border-radius: 10px;
}

.event-film-name {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.event-type-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.event-type-icon { font-size: 0.85rem; }
.event-type-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-lieu {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-personnes {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- GENERAL EVENT (no film) ---- */
.event-general .event-film-bar { background: var(--text-dim); }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  text-align: center;
  gap: 12px;
}
.empty-icon { font-size: 3rem; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.empty-sub { font-size: 0.85rem; color: var(--text-dim); }

/* ---- FILMS GRID ---- */
.films-grid {
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.film-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
  position: relative;
}
.film-card:active { transform: scale(0.98); }

.film-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.film-card-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.film-card-dir {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
  margin-top: 2px;
}
.film-card-sel {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  background: rgba(0,0,0,0.2);
  padding: 3px 9px;
  border-radius: 20px;
}
.film-card-stats {
  padding: 10px 16px 14px;
  background: rgba(0,0,0,0.25);
  display: flex;
  gap: 16px;
}
.film-stat {
  font-size: 0.75rem;
  opacity: 0.75;
}
.film-stat strong { font-size: 1.1rem; font-weight: 800; display: block; }

/* ---- FILM DETAIL ---- */
.film-detail-hero {
  padding: 20px 18px 12px;
  position: relative;
}
.film-detail-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.film-detail-title {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.film-detail-dir {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.film-color-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--bg-card);
  color: var(--text-muted);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--gold);
  color: #0d0d1a;
}

.tab-content { padding: 12px 0; }

/* ---- FORMS ---- */
.form-section { padding: 0 18px; }
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  padding: 12px 14px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--gold); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: none; min-height: 80px; line-height: 1.5; }

.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

/* Color picker */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:active { transform: scale(0.9); }
.color-swatch.selected { border-color: white; transform: scale(1.1); }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-label { font-size: 0.9rem; font-weight: 500; }
.toggle {
  position: relative;
  width: 44px; height: 26px;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px; left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-slider { background: rgba(212,168,67,0.3); border-color: var(--gold); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); background: var(--gold); }

/* ---- ADD VIEW ---- */
.add-options {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.add-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  width: 100%;
  text-align: left;
}
.add-option-btn:active { background: var(--bg-card2); }
.add-option-icon {
  font-size: 1.8rem;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.add-option-text h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.add-option-text p { font-size: 0.8rem; color: var(--text-muted); }

/* ---- MODAL / BOTTOM SHEET ---- */
#modal {
  position: fixed;
  inset: 0;
  z-index: 500;
}
#modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border2);
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}
.modal-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--border2);
  margin: 12px auto 4px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: var(--bg-card2);
  border: none;
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ---- EVENT DETAIL in modal ---- */
.event-detail-film {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.event-detail-type {
  padding: 4px 18px 16px;
  font-size: 1.3rem;
  font-weight: 800;
}
.event-detail-rows { padding: 0 18px; }
.event-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-detail-row:last-child { border-bottom: none; }
.event-detail-icon { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; margin-top: 1px; }
.event-detail-val { font-size: 0.9rem; color: var(--text); line-height: 1.4; }
.event-detail-val small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.event-detail-actions {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
}

/* ---- TOAST ---- */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a50;
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 600;
  white-space: nowrap;
  border: 1px solid var(--border2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeInUp 0.2s ease-out;
}
#toast.hidden { display: none; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- BACK BUTTON ---- */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 18px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.back-btn:active { opacity: 0.7; }

/* ---- INFO ROWS (film detail / contact pages) ---- */
.info-list { padding: 0 18px; }
.info-row {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.info-row:last-child { border-bottom: none; }
.info-icon { font-size: 0.9rem; width: 22px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.info-content { flex: 1; min-width: 0; }
.info-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.info-val { font-size: 0.9rem; color: var(--text); word-break: break-word; }

/* ---- PERSONNE CARD ---- */
.personne-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.personne-name { font-size: 0.95rem; font-weight: 700; }
.personne-role { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.personne-contacts { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.personne-contact-pill {
  font-size: 0.72rem;
  background: var(--bg-card2);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}
.personne-contact-link {
  text-decoration: none;
  border: 1px solid var(--border2);
  color: var(--gold) !important;
  -webkit-tap-highlight-color: transparent;
}
.personne-contact-link:active { opacity: 0.7; }

/* ---- PERSON PICKER ---- */
.person-picker { display: flex; flex-direction: column; gap: 6px; }
.person-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.person-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gold); color: var(--bg-primary);
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 6px 3px 10px; border-radius: 20px;
}
.person-tag-remove {
  background: none; border: none; cursor: pointer;
  color: var(--bg-primary); font-size: 0.85rem; line-height: 1;
  padding: 0; opacity: 0.7; -webkit-tap-highlight-color: transparent;
}
.person-tag-remove:hover { opacity: 1; }
.person-picker-input-wrap { position: relative; }
.person-suggestions {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-height: 220px; overflow-y: auto;
}
.person-suggestion-item {
  padding: 10px 14px; cursor: pointer;
  display: flex; align-items: baseline; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.person-suggestion-item:last-child { border-bottom: none; }
.person-suggestion-item:active { background: var(--bg-secondary); }
.person-suggestion-name { font-size: 0.88rem; font-weight: 600; flex-shrink: 0; }
.person-suggestion-sub { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Clickable person link in event detail */
.person-event-link {
  color: var(--gold); cursor: pointer; text-decoration: underline;
  text-decoration-color: transparent; font-size: 0.88rem;
  -webkit-tap-highlight-color: transparent;
}
.person-event-link:active { opacity: 0.7; }

/* ---- SCROLL WEEK BAR ---- */
/* ---- TABLEAU VIEW ---- */
.tableau-wrap { padding: 0 0 24px; overflow-x: auto; }
.tableau-header { display: flex; padding-left: 44px; gap: 2px; padding-right: 8px; margin-bottom: 4px; }
.tableau-col-header { padding: 6px 6px 4px; text-align: center; flex-shrink: 0; }
.tableau-row { display: flex; align-items: flex-start; margin-bottom: 2px; }
.tableau-time { width: 44px; flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; padding: 6px 6px 0 18px; line-height: 1; }
.tableau-cells { display: flex; flex: 1; gap: 2px; padding-right: 8px; }
.tableau-cell { flex-shrink: 0; min-height: 10px; display: flex; flex-direction: column; gap: 2px; }
.tableau-evt { border-radius: 6px; padding: 5px 6px; cursor: pointer; transition: opacity 0.15s; }
.tableau-evt:active { opacity: 0.7; }
.tableau-evt-dim { opacity: 0.35; }
.tableau-evt-type { font-size: 0.7rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.tableau-evt-lieu { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

.week-bar {
  display: flex;
  gap: 6px;
  padding: 8px 18px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.week-bar::-webkit-scrollbar { display: none; }
.week-day-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  min-width: 46px;
}
.week-day-btn.active {
  background: var(--gold);
  border-color: var(--gold);
}
.week-day-btn.has-events::after {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.week-day-btn.active.has-events::after { background: rgba(0,0,0,0.4); }
.wdb-day {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.week-day-btn.active .wdb-day { color: rgba(0,0,0,0.7); }
.wdb-num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.week-day-btn.active .wdb-num { color: #0d0d1a; }

/* ---- FILM FILTER CHIPS ---- */
.filter-chips {
  display: flex;
  gap: 6px;
  padding: 4px 18px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  opacity: 0.5;
}
.filter-chip.active { opacity: 1; border-color: rgba(255,255,255,0.3); }

/* ---- SETTINGS ---- */
.settings-section {
  padding: 0 18px 8px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 0.9rem; font-weight: 500; }
.settings-value { font-size: 0.85rem; color: var(--text-muted); }
.settings-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- CONFIRM DIALOG ---- */
.confirm-dialog { padding: 20px 18px; text-align: center; }
.confirm-dialog h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.confirm-dialog p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; }

/* ---- UTIL ---- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.p-18 { padding: 0 18px; }
.pb-8 { padding-bottom: 8px; }

/* ---- FILTER PILL ---- */
.filter-pill {
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill.active {
  background: rgba(212,168,67,0.15);
  border-color: var(--gold);
  color: var(--gold);
}
.event-star { font-size: 0.75rem; margin-left: auto; }

/* ---- INTERVIEW SLOTS ---- */
.slot-row { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:7px; align-items:center; }
.slot-row .form-control { padding:8px 8px; font-size:0.78rem; }
.slot-heure { width:82px !important; flex-shrink:0; }
.slot-tipo { width:54px !important; flex-shrink:0; padding:8px 4px !important; text-align:center; cursor:pointer; }
.slot-media { flex:1; min-width:90px; }
.slot-periodista { flex:1.2; min-width:90px; font-style:italic; }
.slot-dur { width:52px !important; flex-shrink:0; text-align:center; -moz-appearance:textfield; }
.slot-dur::-webkit-outer-spin-button, .slot-dur::-webkit-inner-spin-button { -webkit-appearance:none; }
.slot-min-label { color:var(--text-muted); font-size:0.75rem; flex-shrink:0; }
.slot-remove { background:none; border:1px solid var(--border2); color:var(--text-muted); border-radius:var(--radius-xs); width:28px; height:36px; cursor:pointer; flex-shrink:0; font-size:0.75rem; line-height:1; }
.event-slots-preview { font-size:0.72rem; color:var(--text-muted); margin-top:4px; }
.slots-table { width:100%; border-collapse:collapse; font-size:0.82rem; }
.slots-table td { padding:5px 6px; border-bottom:1px solid var(--border); vertical-align:middle; }
.slots-table tr:last-child td { border-bottom:none; }

/* Large screen tweaks */
@media (min-width: 480px) {
  #app { box-shadow: 0 0 60px rgba(0,0,0,0.5); }
  #app-header, #bottom-nav { left: 50%; transform: translateX(-50%); }
}

/* ---- GENERIC HIDDEN ---- */
.hidden { display: none !important; }

/* ---- LOGIN ---- */
#login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}
.login-container {
  width: 100%; max-width: 320px; text-align: center;
}
.login-logo { margin-bottom: 4px; }
.login-logo .logo-cannes { font-size: 2rem; font-weight: 900; letter-spacing: 0.1em; }
.login-logo .logo-cannes-accent { color: var(--gold); }
.login-subtitle { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 32px; }
.btn-full { width: 100%; }

/* ---- CHAT ASSISTANT ---- */
.chat-messages {
  overflow-y: auto;
  padding: 16px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: calc(100vh - 240px);
}
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 86%; }
.chat-msg-user { align-self: flex-end; align-items: flex-end; }
.chat-msg-assistant { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-assistant {
  background: var(--surface);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-loading { display: flex; align-items: center; gap: 4px; padding: 14px 16px; }
.chat-loading span {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: chatdot 1.1s infinite ease-in-out;
}
.chat-loading span:nth-child(2) { animation-delay: 0.18s; }
.chat-loading span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chatdot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.chat-preview {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
  max-width: 100%;
}
.chat-preview-group { margin-bottom: 8px; }
.chat-preview-group:last-of-type { margin-bottom: 10px; }
.chat-preview-label { font-weight: 700; color: var(--text-primary); margin-bottom: 3px; font-size: 0.75rem; letter-spacing: 0.03em; }
.chat-preview-item { color: var(--text-muted); padding: 1px 0 1px 10px; line-height: 1.4; }
.chat-preview-meta { color: var(--text-muted); font-style: italic; }
.chat-apply-btn { margin-top: 2px; font-size: 0.8rem !important; padding: 6px 12px !important; width: 100%; }
.chat-applied { margin-top: 6px; font-size: 0.8rem; color: #27ae60; font-weight: 600; }
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  align-items: flex-end;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
  font-family: inherit;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-send-btn:active { opacity: 0.8; }
.chat-mic-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border2);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-mic-btn:active { opacity: 0.8; }

/* ---- VOITURES ---- */
.voiture-builder-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.voiture-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.voiture-num {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.voiture-add-person-btn {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 600; color: var(--gold);
  background: none; border: 1px dashed var(--border2);
  border-radius: 20px; padding: 3px 10px; cursor: pointer;
  margin-top: 6px; -webkit-tap-highlight-color: transparent;
}
.voiture-add-person-btn:active { opacity: 0.7; }
.voiture-picker-search-wrap { position: relative; }
.voiture-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.85rem;
}
.voiture-people { color: var(--text-primary); }
