@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0f0a;
  font-family: 'Segoe UI', sans-serif;
  color: #f0ede6;
}

.login-container {
  background: #0f1a0f;
  border: 1px solid #2a3a2a;
  border-radius: 12px;
  padding: 2.5rem;
  width: 360px;
  text-align: center;
  box-shadow: 0 0 30px rgba(80, 180, 80, 0.1);
}

h1 {
  font-size: 1.8rem;
  color: #80cc80;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: #a89f94;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #0a0f0a;
  border: 1px solid #2a3a2a;
  border-radius: 8px;
  color: #f0ede6;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #80cc80;
}

button {
  width: 100%;
  padding: 0.75rem;
  background: #80cc80;
  color: #0a0f0a;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #60aa60;
}

#error-msg {
  color: #ff6b6b;
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* === DASHBOARD === */

.dashboard-container {
  min-height: 100vh;
  width: 100%;
  padding: 2rem;
  background: #0a0f0a;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid #2a3a2a;
  padding-bottom: 1.5rem;
}

header h1 {
  font-size: 1.5rem;
  color: #80cc80;
}

header .subtitle {
  color: #a89f94;
  font-size: 1rem;
  margin: 0;
}

#logoutBtn {
  background: transparent;
  border: 1px solid #2a3a2a;
  color: #a89f94;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  width: auto;
  transition: all 0.2s;
}

#logoutBtn:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.welcome-text {
  color: #f0ede6;
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
  line-height: 1.7;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.menu-card {
  background: #0f1a0f;
  border: 1px solid #2a3a2a;
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: #f0ede6;
  transition: all 0.2s;
}

.menu-card:hover {
  border-color: #80cc80;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(80, 180, 80, 0.15);
}

.menu-card .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.8rem;
}

.menu-card h2 {
  font-size: 1.1rem;
  color: #80cc80;
  margin-bottom: 0.5rem;
}

.menu-card p {
  font-size: 0.85rem;
  color: #a89f94;
  line-height: 1.5;
}

/* === PAGES INTERNES === */

.page-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #0f1a0f;
  border-right: 1px solid #2a3a2a;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.back-btn {
  display: inline-block;
  color: #80cc80;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: opacity 0.2s;
}

.back-btn:hover {
  opacity: 0.7;
}

.sidebar h2 {
  color: #80cc80;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.sidebar-subtitle {
  color: #a89f94;
  font-size: 0.75rem;
  margin-bottom: 2rem;
  line-height: 1.4;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  text-decoration: none;
  color: #a89f94;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.sidebar-link:hover {
  background: #1a2e1a;
  color: #80cc80;
}

.sidebar-link.active {
  background: #1a2e1a;
  color: #80cc80;
}

.sidebar-link.disabled {
  color: #3a3a3a;
  cursor: not-allowed;
  pointer-events: none;
}

/* Contenu */
.page-content {
  flex: 1;
  padding: 2.5rem;
  background: #f5f2eb;
  min-height: 100vh;
  color: #1a1a1a;
}

.etape-section {
  margin-bottom: 4rem;
}

.etape-section h1 {
  font-size: 1.6rem;
  color: #3a7a3a;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: normal;
}

.badge.current {
  background: #1a2e1a;
  color: #80cc80;
  border: 1px solid #80cc80;
}

.badge.upcoming {
  background: #e0ddd6;
  color: #a89f94;
  border: 1px solid #c5c0b8;
}

.content-block {
  background: #ffffff;
  border: 1px solid #d5d0c8;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.content-block h3 {
  color: #3a7a3a;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Tableau calendrier */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calendar-table th {
  text-align: left;
  color: #888078;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #d5d0c8;
}

.calendar-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #d5d0c8;
  color: #1a1a1a;
}

.status {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.status.done {
  background: #1a2e1a;
  color: #80cc80;
}

.status.pending {
  background: #2a2a1a;
  color: #ccaa40;
}

/* Documents */
.docs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f0ede6;
  border: 1px solid #d5d0c8;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.doc-icon {
  font-size: 1.5rem;
}

.doc-info {
  flex: 1;
}

.doc-title {
  color: #1a1a1a;
  font-size: 0.9rem;
}

.doc-meta {
  color: #888078;
  font-size: 0.75rem;
}

.doc-expand {
  background: #1a2e1a;
  color: #80cc80;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.doc-expand:hover {
  background: #2a3e2a;
}

.doc-note {
  display: none;
  background: #f0ede6;
  border: 1px solid #d5d0c8;
  border-radius: 8px;
  padding: 1rem;
  color: #1a1a1a;
  font-size: 0.9rem;
  line-height: 1.6;
}

.doc-note.open {
  display: block;
}

/* Section verrouillée */
.etape-section.locked h1 {
  color: #aaa;
}

.locked-msg {
  color: #888078;
  font-size: 0.95rem;
}

/* === COURS BLOCKS === */

.etape-meta {
  color: #888078;
  font-size: 0.85rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.cours-block {
  border: 1px solid #d5d0c8;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: #faf8f4;
}

.cours-block.locked {
  opacity: 0.5;
}

.cours-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.cours-code {
  font-size: 0.8rem;
  font-weight: bold;
  color: #3a7a3a;
  background: #e8f5e8;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.cours-titre {
  font-size: 1rem;
  color: #1a1a1a;
  flex: 1;
}

.cours-info {
  font-size: 0.8rem;
  color: #888078;
  white-space: nowrap;
}

.muted {
  color: #aaa !important;
}

/* Sidebar subnav */
.sidebar-subnav {
  list-style: none;
  padding: 0 0 0.5rem 1rem;
  margin: 0;
}

.sidebar-sublink {
  display: block;
  text-decoration: none;
  color: #6a9a6a;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar-sublink:hover {
  background: #1a2e1a;
  color: #80cc80;
}

.sidebar-sublink.active {
  background: #1a2e1a;
  color: #80cc80;
  font-weight: bold;
}

.sidebar-subnav.muted .sidebar-sublink {
  color: #3a3a3a;
}

.modalite-toggle {
  background: #e8f5e8;
  border: 1px solid #3a7a3a;
  color: #3a7a3a;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
}

.modalite-toggle:hover {
  background: #3a7a3a;
  color: white;
}

.modalite.hybride {
  color: #3a7a3a;
  font-weight: bold;
}

.modalite.presence {
  color: #888078;
}

.cours-view.hidden {
  display: none;
}

.sidebar-etape-label {
  color: #80cc80;
  font-size: 0.95rem;
  font-weight: bold;
  padding: 0.5rem 0.75rem 0.25rem 0.75rem;
  margin-top: 0.5rem;
}

.sidebar-etape-label.muted {
  color: #3a3a3a;
}

.sidebar-etape-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  transition: background 0.2s;
}

.sidebar-etape-header:hover {
  background: #1a2e1a;
}

.sidebar-etape-header.locked:hover {
  background: transparent;
  cursor: default;
}

.etape-arrow {
  font-size: 0.8rem;
  color: #80cc80;
  transition: transform 0.2s;
}

.etape-arrow.muted {
  color: #3a3a3a;
}

.sidebar-subnav.collapsed {
  display: none;
}

/* === CALENDRIER ÉDITABLE === */

.calendrier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Bouton + dans l'en-tête de cours */
.btn-ajouter-module {
  margin-left: auto;
  background: #3a7a3a;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.btn-ajouter-module:hover {
  background: #2a5a2a;
  transform: scale(1.1);
}

/* Menu flottant */
.menu-ajout {
  position: fixed;
  background: #fff;
  border: 1px solid #d5d0c8;
  border-radius: 10px;
  padding: 0.4rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 150px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}

.menu-ajout.hidden { display: none; }

.menu-ajout-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}

.menu-ajout-item:hover { background: #f0ede6; }
.menu-ajout-icone { font-size: 1rem; }

/* Conteneur de groupes */
.sections-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}

.sections-empty {
  color: #aaa;
  font-style: italic;
  font-size: 0.88rem;
  padding: 1.5rem 0.5rem;
  text-align: center;
}

/* Carte de groupe */
.groupe-card {
  border: 1px solid #d5d0c8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.groupe-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #f0ede6;
  border-bottom: 1px solid #d5d0c8;
}

.groupe-titre {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1a1a1a;
  flex: 1;
}

.groupe-count {
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
}

.groupe-progress {
  font-size: 0.75rem;
  font-weight: bold;
  color: #3a7a3a;
  background: #e8f5e8;
  border: 1px solid #b8d8b8;
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

.groupe-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-ajouter-dans-groupe {
  background: #3a7a3a;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-ajouter-dans-groupe:hover { background: #2a5a2a; }

/* Items dans un groupe */
.groupe-items {
  display: flex;
  flex-direction: column;
}

.groupe-empty {
  color: #aaa;
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.9rem 1rem;
  text-align: center;
}

/* Bloc Échéance */
.bloc-echeance {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #f0ede6;
  font-size: 0.9rem;
  background: #fff;
}

.bloc-echeance:last-child { border-bottom: none; }

.bloc-echeance.echeance-complete .echeance-date,
.bloc-echeance.echeance-complete .echeance-desc {
  text-decoration: line-through;
  color: #bbb;
}

.echeance-date {
  color: #888078;
  white-space: nowrap;
  font-size: 0.82rem;
  min-width: 7rem;
}

.echeance-desc {
  flex: 1;
  color: #1a1a1a;
}

.bloc-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

/* Note card dans un groupe */
.groupe-items .note-card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #f0ede6;
  background: #faf9f6;
}

.groupe-items .note-card:last-child { border-bottom: none; }

.btn-ajouter {
  background: #e8f5e8;
  border: 1px solid #3a7a3a;
  color: #3a7a3a;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  width: auto;
  transition: all 0.2s;
}

.btn-ajouter:hover {
  background: #3a7a3a;
  color: white;
}

.echeance-check {
  width: 1rem;
  height: 1rem;
  padding: 0;
  margin: 0;
  cursor: pointer;
  accent-color: #3a7a3a;
  flex-shrink: 0;
  align-self: center;
}

.echeance-complete td {
  text-decoration: line-through;
  color: #aaa !important;
}

.echeance-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-edit, .btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  width: auto;
  transition: background 0.2s;
}

.btn-edit:hover { background: #e8f5e8; }
.btn-delete:hover { background: #fde8e8; }

.empty-row td {
  color: #aaa;
  font-style: italic;
  font-size: 0.85rem;
  padding: 1rem 0.75rem;
}

/* === MODAL === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-box h3 {
  color: #3a7a3a;
  margin-bottom: 0.5rem;
}

.modal-box label {
  font-size: 0.85rem;
  color: #888078;
  margin-bottom: -0.5rem;
}

.modal-box input {
  background: #f5f2eb;
  border: 1px solid #d5d0c8;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  width: 100%;
}

.modal-box input:focus {
  border-color: #3a7a3a;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-cancel {
  flex: 1;
  background: #f0ede6;
  border: 1px solid #d5d0c8;
  color: #888078;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
  width: auto;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: #e0ddd6;
}

.btn-save {
  flex: 1;
  background: #3a7a3a;
  border: none;
  color: white;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
  font-weight: bold;
  width: auto;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #2a5a2a;
}

/* === NOTES === */

.notes-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notes-empty {
  color: #aaa;
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.note-card {
  background: #f0ede6;
  border: 1px solid #d5d0c8;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.note-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.note-icone {
  font-size: 1rem;
}

.note-titre {
  flex: 1;
  font-weight: bold;
  font-size: 0.9rem;
  color: #1a1a1a;
}

.note-actions {
  display: flex;
  gap: 0.3rem;
}

.note-contenu {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-lien {
  font-size: 0.88rem;
  color: #3a7a3a;
  text-decoration: none;
  word-break: break-all;
}

.note-lien:hover {
  text-decoration: underline;
}

.note-type-pdf { border-left: 3px solid #e8a020; }
.note-type-lien { border-left: 3px solid #3a7a3a; }
.note-type-reference { border-left: 3px solid #4a7aaa; }
.note-type-texte { border-left: 3px solid #a89f94; }

/* Modal note */
.modal-box textarea {
  background: #f5f2eb;
  border: 1px solid #d5d0c8;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  width: 100%;
  resize: vertical;
  font-family: 'Segoe UI', sans-serif;
}

.modal-box textarea:focus {
  border-color: #3a7a3a;
  outline: none;
}

.modal-box select {
  background: #f5f2eb;
  border: 1px solid #d5d0c8;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  width: 100%;
  cursor: pointer;
}

.modal-box select:focus {
  border-color: #3a7a3a;
  outline: none;
}

.hidden {
  display: none !important;
}

/* Wrapper pour les permissions avec overlay admin */
.perms-wrap {
  position: relative;
}
.perms-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 242, 235, 0.75);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: not-allowed;
  backdrop-filter: blur(1px);
}
.perms-overlay span {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #c0392b;
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-style: italic;
  pointer-events: none;
}
/* =============================
   SECTION BIÈRE
   ============================= */

.biere-intro {
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
  color: #a89f94;
  font-size: 1rem;
}

/* Grande section (Lager / Ale / Spontanée) */
.biere-section {
  max-width: 1000px;
  margin: 0 auto 3rem auto;
}

.biere-section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.biere-section-header.lager     { background: #0a1420; border: 1px solid #2a5060; }
.biere-section-header.ale       { background: #0f1a0a; border: 1px solid #3a6020; }
.biere-section-header.spontanee { background: #1a0a1a; border: 1px solid #6a3a70; }

.biere-section-icone { font-size: 2rem; flex-shrink: 0; margin-top: 2px; }

.biere-section-header h2 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
}
.biere-section-header.lager h2     { color: #60b8c8; }
.biere-section-header.ale h2       { color: #80cc80; }
.biere-section-header.spontanee h2 { color: #c080c8; }

.biere-section-header p {
  color: #a89f94;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

/* Sous-section (Blondes, Blé, Belges, etc.) */
.biere-sous-section {
  margin-bottom: 1.75rem;
}
.biere-sous-titre {
  color: #6a9a6a;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #1a2e1a;
}

/* Grille des cartes */
.biere-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

/* Carte bière */
.biere-carte {
  background: #0f1a0f;
  border: 1px solid #2a3a2a;
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.biere-carte:hover { border-color: #3a7a3a; }

.biere-carte-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.biere-emoji { font-size: 1.6rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.biere-nom { color: #80cc80; font-size: 0.98rem; margin-bottom: 0.25rem; }

/* Badges fermentation */
.biere-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 8px;
}
.biere-badge.ale       { background: #1a2e10; color: #80cc80; border: 1px solid #3a7a3a; }
.biere-badge.lager     { background: #0a1820; color: #60b8c8; border: 1px solid #2a6a78; }
.biere-badge.spontanee { background: #1a0a1a; color: #c080c8; border: 1px solid #6a3a70; }

.biere-desc {
  color: #c8c0b8;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
}

/* Détails */
.biere-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.biere-detail {
  display: flex;
  flex-direction: column;
  background: #0a0f0a;
  border: 1px solid #1a2a1a;
  border-radius: 5px;
  padding: 0.3rem 0.5rem;
}
.detail-label { color: #6a9a6a; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-val   { color: #f0ede6; font-size: 0.8rem; font-weight: 600; }

/* Section verre */
.biere-verre {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: #0a1a0a;
  border: 1px solid #2a5a2a;
  border-radius: 7px;
  padding: 0.65rem;
  margin-top: auto;
}
.verre-icone { font-size: 1.3rem; flex-shrink: 0; }
.biere-verre > div { display: flex; flex-direction: column; gap: 0.15rem; }
.verre-label  { color: #6a9a6a; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; }
.verre-nom    { color: #80cc80; font-size: 0.85rem; font-weight: bold; }
.verre-raison { color: #a89f94; font-size: 0.75rem; line-height: 1.4; }

/* Exemples */
.biere-exemples {
  color: #6a9a6a;
  font-size: 0.75rem;
  font-style: italic;
  border-top: 1px solid #1a2a1a;
  padding-top: 0.45rem;
  margin-top: auto;
}

/* =============================
   SECTION HOCKEY
   ============================= */

/* Recherche */
.hockey-search-block {
  max-width: 600px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

.hockey-section-title {
  color: #80cc80;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  font-weight: bold;
}

.hockey-search-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hockey-search-group input {
  margin-bottom: 0;
  flex: 1;
}

.hockey-search-group button {
  width: auto;
  padding: 0 1.5rem;
  height: 42px; /* S'assure que le bouton a la même hauteur que l'input */
}

.hockey-error {
  color: #ff6b6b;
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* Fiche Joueur - Layout principal */
#hockey-fiche {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* En-tête (Identité & Logos) */
.hockey-fiche-header {
  background: #0f1a0f;
  border: 1px solid #2a3a2a;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.joueur-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2a3a2a;
  background: #0a0f0a;
}

.joueur-identite {
  flex: 1;
}

#joueur-nom {
  color: #80cc80;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

#joueur-meta {
  color: #a89f94;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.equipe-badge {
  display: inline-block;
  background: #1a2e1a;
  color: #80cc80;
  border: 1px solid #3a7a3a;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
}

.equipe-logo {
  width: 65px;
  height: 65px;
  object-fit: contain;
}

/* Conteneur des cartes (Stats, Contrats) */
.hockey-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hockey-card {
  background: #0f1a0f;
  border: 1px solid #2a3a2a;
  border-radius: 12px;
  padding: 1.5rem;
}

.hockey-card h3, .hockey-card-header h3 {
  color: #80cc80;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

/* En-tête de carte avec bouton légende */
.hockey-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.hockey-card-header h3 {
  margin-bottom: 0;
}

.btn-legende {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #3a7a3a;
  color: #80cc80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-legende:hover {
  background: #1a2e1a;
  border-color: #80cc80;
}

/* Légende escamotable */
.legende-stats {
  background: #0a0f0a;
  border: 1px solid #2a3a2a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.legende-item {
  display: flex;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.legende-code {
  color: #80cc80;
  font-weight: bold;
  min-width: 35px;
}

.legende-desc {
  color: #a89f94;
}

/* Grille de statistiques (Petites boîtes) */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stats-grid > div {
  background: #0a0f0a;
  border: 1px solid #2a3a2a;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Le label de la stat (ex: PJ, B, Cap Hit) */
.stats-grid > div > :first-child {
  color: #a89f94;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* La valeur de la stat (ex: 57, $7.85M) */
.stats-grid > div > :last-child {
  color: #f0ede6;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Liens dans les cartes (PuckPedia, etc.) */
.hockey-card a {
  color: #6a9a6a;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 1.2rem;
  transition: color 0.2s;
}

.hockey-card a:hover {
  color: #80cc80;
}

/* Historique contrats texte */
#joueur-historique {
  color: #f0ede6;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Boutons de résultats de recherche (Liste) */
.hockey-resultats-liste {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

.hockey-resultats-liste button {
  background: #0f1a0f;           /* Fond sombre au lieu du vert flash */
  color: #f0ede6;                /* Texte clair */
  border: 1px solid #2a3a2a;       /* Bordure subtile */
  text-align: left;              /* Aligner le nom à gauche */
  font-weight: normal;
  padding: 0.8rem 1.2rem;
  transition: all 0.2s;
}

.hockey-resultats-liste button:hover {
  background: #1a2e1a;           /* Fond légèrement plus clair au survol */
  border-color: #80cc80;         /* Bordure verte au survol */
  color: #80cc80;
  transform: translateX(5px);    /* Petit effet de glissement vers la droite */
}

/* Lien PuckPedia dans l'en-tête du joueur */
.puckpedia-header-link {
  color: #80cc80;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid #80cc80;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.puckpedia-header-link:hover {
  background: #80cc80;
  color: #0a0f0a;
}

/* Bouton Accueil en haut à droite */
.back-btn-dash {
  background: #000000;
  color: #a89f94;
  border: 1px solid #2a3a2a;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-btn-dash:hover {
  background: #1a2e1a;
  border-color: #80cc80;
  color: #80cc80;
}

/* Bouton Archive — fixé en bas à droite du dashboard */
.archive-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #4a4a4a;
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  z-index: 10;
  letter-spacing: 0.03rem;
}
.archive-btn:hover {
  border-color: #555;
  color: #888;
}

/* =============================
   SECTION AVIATION - METAR
   ============================= */

/* Bouton "Charger un exemple" */
.metar-exemple {
  display: inline-block;
  margin-top: 1rem;
  color: #3a7a3a;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #e8f5e8;
  border: 1px solid #3a7a3a;
  transition: all 0.2s;
  width: fit-content;
}

.metar-exemple:hover {
  background: #3a7a3a;
  color: #ffffff;
}

/* Tableau des remarques (RMK) */
.remarques-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.remarques-table th {
  text-align: left;
  color: #888078;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid #d5d0c8;
}

.remarques-table td {
  padding: 1rem;
  border-bottom: 1px solid #e0ddd6;
  color: #1a1a1a;
  vertical-align: top;
  line-height: 1.5;
}

.remarques-table tr:hover td {
  background-color: #faf8f4;
}

.remarque-code {
  font-family: monospace;
  font-weight: bold;
  color: #3a7a3a;
  background: #e8f5e8;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* === NOUVELLE MISE EN PAGE HOCKEY === */
.hockey-wide-container {
  max-width: 1200px;
  width: 95%;
  margin: 0 auto;
}

.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stats-colonne {
  display: flex;
  flex-direction: column;
}

.contrats-section {
  margin-top: 2rem;
  background: #0f150f;
  border: 1px solid #2a3a2a;
  border-radius: 8px;
  padding: 1.5rem;
}

.contrats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.contrat-card {
  background: #162216;
  border: 1px solid #3a4a3a;
  padding: 1.2rem;
  border-radius: 6px;
  transition: transform 0.2s, border-color 0.2s;
}

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

/* Ajustement des boutons de recherche pour matcher avec le style sombre */
.hockey-resultats-liste button {
  background: #0f1a0f;
  color: #f0ede6;
  border: 1px solid #2a3a2a;
  text-align: left;
  padding: 0.8rem 1.2rem;
  transition: all 0.2s;
  cursor: pointer;
  border-radius: 8px;
}

.hockey-resultats-liste button:hover {
  background: #1a2e1a;
  border-color: #80cc80;
  transform: translateX(5px);
}

/* Sur les téléphones, on empile les colonnes au lieu de les mettre côte à côte */
@media (max-width: 768px) {
  .stats-split {
    grid-template-columns: 1fr;
  }
}

/* === ANIMATION DE CHARGEMENT (SPINNER) === */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #162216; /* Couleur de fond (vert très foncé) */
  border-top: 4px solid #d4892a; /* Couleur d'accent (Ambre) */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner-mini-wrap {
  display: flex;
  align-items: center;
}

.spinner-mini {
  width: 16px;
  height: 16px;
  border: 2px solid #162216;
  border-top: 2px solid #d4892a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-text {
  color: #a89f94;
  font-size: 0.95rem;
  font-style: italic;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
  min-width: 270px;
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: #a89f94;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.loading-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-step .step-icon {
  font-size: 0.75rem;
  min-width: 1em;
  color: #60b8c8;
}

.loading-step.step-done {
  color: #80cc80;
}

.loading-step.step-done .step-icon {
  color: #80cc80;
}

.loading-step.step-fail {
  color: #cc6060;
}

.loading-step.step-fail .step-icon {
  color: #cc6060;
}

/* === ÉTAPES PAR SECTION === */
.section-steps {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.3rem 0 0.6rem;
}

.section-step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #a89f94;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.section-step.visible {
  opacity: 1;
  transform: translateX(0);
}

.section-step .step-icon {
  font-size: 0.68rem;
  min-width: 1em;
  text-align: center;
  color: #60b8c8;
}

.section-step.step-done { color: #80cc80; }
.section-step.step-done .step-icon { color: #80cc80; }
.section-step.step-fail { color: #cc6060; }
.section-step.step-fail .step-icon { color: #cc6060; }

/* === JOURNAL DES MATCHS === */
.gamelog-table { width: 100%; }

.gamelog-row {
  display: grid;
  padding: 0.42rem 0.25rem;
  gap: 0.4rem;
  border-bottom: 1px solid #1a2a1a;
  color: #f0ede6;
  align-items: center;
  font-size: 0.82rem;
}

.gamelog-row-skater { grid-template-columns: 72px 62px 1fr 1fr 1fr 1fr 1fr; }
.gamelog-row-goalie { grid-template-columns: 72px 62px 1fr 1fr 1fr 1fr 1fr; }

.gamelog-header {
  color: #a89f94;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #3a4a3a;
  font-weight: bold;
  padding-bottom: 0.5rem;
}

.gamelog-row:not(.gamelog-header):hover { background: #0a120a; border-radius: 4px; }
.gamelog-win  { color: #80cc80; font-weight: bold; }
.gamelog-loss { color: #cc6060; }
.gamelog-pts  { color: #d4892a; font-weight: bold; }

/* === FILMS & SÉRIES === */

.films-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem 0.5rem;
}

.film-stat-badge {
  background: #f0ede6;
  border: 1px solid #d5d0c8;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: #555;
}

.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

.film-card {
  background: #fff;
  border: 1px solid #d5d0c8;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}

.film-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.film-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.film-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.film-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.badge-a-voir {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.badge-en-cours {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #60b8c8;
}

.badge-vu {
  background: #d4edda;
  color: #155724;
  border: 1px solid #80cc80;
}

.film-type-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  background: #ede8f5;
  color: #5a3e8a;
  border: 1px solid #c080c8;
  font-weight: bold;
}

.film-type-badge.serie {
  background: #fff0e0;
  color: #7a4400;
  border: 1px solid #d4892a;
}

.film-titre {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a1a1a;
  line-height: 1.3;
}

.film-infos {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.film-genre {
  font-size: 0.8rem;
  color: #555;
  background: #f0ede6;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
}

.film-annee {
  font-size: 0.8rem;
  color: #888;
}

.film-etoiles {
  font-size: 1rem;
  color: #d4892a;
  letter-spacing: 2px;
}

.film-commentaire {
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #e8e4dc;
  padding-top: 0.5rem;
  line-height: 1.5;
  font-style: italic;
}

/* Étoiles dans le modal */
.etoiles-input {
  display: flex;
  gap: 0.3rem;
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.etoile {
  color: #d5d0c8;
  transition: color 0.15s;
  user-select: none;
}

.etoile.etoile-active {
  color: #d4892a;
}

.etoile.etoile-survol {
  color: #e8a84a;
}

/* ============================================
   FILMS PAGE — THÈME SOMBRE
   ============================================ */

body.films-page {
  background: #0a0a0a;
  color: #d0d0d0;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  /* Annule le centrage vertical global */
  display: block;
  align-items: unset;
  justify-content: unset;
}

body.films-page button {
  width: auto;
}

/* --- Topbar --- */
.films-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #111111;
  border-bottom: 1px solid #1f1f1f;
  padding: 0.65rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.films-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.films-back-btn {
  color: #4a9a4a;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #2a4a2a;
  border-radius: 6px;
  background: #0f1f0f;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.films-back-btn:hover {
  background: #1a3a1a;
  color: #6fcf6f;
}

.films-topbar-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #39d353;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.films-topbar-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
}

.films-filter-nav {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* Override sidebar-sublink dans le contexte topbar films */
.films-filter-nav .sidebar-sublink {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #888;
  background: #181818;
  border: 1px solid #2a2a2a;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.films-filter-nav .sidebar-sublink:hover {
  color: #39d353;
  border-color: #2a4a2a;
  background: #0f1f0f;
}

.films-filter-nav .sidebar-sublink.active {
  color: #39d353;
  background: #0f2a0f;
  border-color: #39d353;
  font-weight: bold;
}

.films-filter-sep {
  width: 1px;
  height: 20px;
  background: #2a2a2a;
  flex-shrink: 0;
}

.films-add-btn {
  margin-left: auto;
  background: #0f2a0f;
  border: 1px solid #39d353;
  color: #39d353;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.films-add-btn:hover {
  background: #1a4a1a;
}

/* --- Contenu principal --- */
.films-main {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.films-main-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.films-section-titre {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #39d353;
  margin: 0;
}

/* Stats badges — dark */
body.films-page .films-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
}

body.films-page .film-stat-badge {
  background: #161616;
  border: 1px solid #2a2a2a;
  color: #4a9a4a;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
}

/* --- Grille de cartes --- */
body.films-page .films-grid {
  display: grid;
  gap: 0.9rem;
  padding: 0;
}

/* --- Sections Films / Séries --- */
.films-section-block {
  margin-bottom: 2rem;
}

.films-section-subhead {
  font-size: 1rem;
  font-weight: 600;
  color: #39d353;
  padding: 0.4rem 1.5rem 0.6rem;
  border-bottom: 1px solid #1a2a1a;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

/* --- Cartes style poster --- */
body.films-page .films-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

body.films-page .film-card {
  background: #141414;
  border: 1px solid #232323;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.films-page .film-card:hover {
  border-color: #2a4a2a;
  box-shadow: 0 0 16px rgba(57, 211, 83, 0.12);
}

.film-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.film-poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: #0f0f0f;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #2a2a2a;
}

.film-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

body.films-page .film-titre {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #e0e0e0;
  line-height: 1.3;
}

body.films-page .film-genre {
  font-size: 0.78rem;
  color: #4a9a4a;
  background: #0f1f0f;
  border: 1px solid #1a3a1a;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
}

body.films-page .film-annee {
  font-size: 0.78rem;
  color: #555;
}

body.films-page .film-etoiles {
  font-size: 1rem;
  color: #39d353;
  letter-spacing: 2px;
}

body.films-page .film-commentaire {
  font-size: 0.82rem;
  color: #666;
  border-top: 1px solid #1e1e1e;
  padding-top: 0.5rem;
  line-height: 1.5;
  font-style: italic;
}

/* Type badges */
body.films-page .film-type-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  background: #1a1a2e;
  color: #8080cc;
  border: 1px solid #3030aa;
  font-weight: bold;
}

body.films-page .film-type-badge.serie {
  background: #1e1a0a;
  color: #cc9a40;
  border: 1px solid #7a5a10;
}

/* Statut badges */
body.films-page .badge-a-voir {
  background: #1a1a00;
  color: #cccc00;
  border: 1px solid #666600;
}

body.films-page .badge-en-cours {
  background: #001a2a;
  color: #40aacc;
  border: 1px solid #006080;
}

body.films-page .badge-vu {
  background: #001a00;
  color: #39d353;
  border: 1px solid #1a6a1a;
}

/* Boutons edit/delete */
body.films-page .btn-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.3rem;
  border-radius: 5px;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
}

body.films-page .btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.3rem;
  border-radius: 5px;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
}

body.films-page .btn-edit:hover {
  background: #0f2a0f;
  opacity: 1;
}

body.films-page .btn-delete:hover {
  background: #2a0f0f;
  opacity: 1;
}

/* Message vide */
body.films-page .notes-empty {
  color: #444;
  padding: 2rem;
  text-align: center;
  font-style: italic;
}

/* --- Modal dark --- */
body.films-page .modal-overlay {
  background: rgba(0, 0, 0, 0.85);
}

body.films-page .films-modal-box {
  background: #111111;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.films-page .films-modal-box h3 {
  color: #39d353;
  margin-bottom: 0.5rem;
}

body.films-page .films-modal-box label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.15rem;
  display: block;
}

body.films-page .films-modal-box input,
body.films-page .films-modal-box select,
body.films-page .films-modal-box textarea {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #d0d0d0;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

body.films-page .films-modal-box input:focus,
body.films-page .films-modal-box select,
body.films-page .films-modal-box textarea:focus {
  border-color: #39d353;
  outline: none;
}

body.films-page .films-modal-box .modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

body.films-page .films-modal-box .btn-cancel {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

body.films-page .films-modal-box .btn-cancel:hover {
  background: #222;
}

body.films-page .films-modal-box .btn-save {
  flex: 1;
  background: #0f2a0f;
  border: 1px solid #39d353;
  color: #39d353;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

body.films-page .films-modal-box .btn-save:hover {
  background: #1a4a1a;
}

body.films-page .etoile {
  color: #2a2a2a;
}

body.films-page .etoile.etoile-active {
  color: #39d353;
}

body.films-page .etoile.etoile-survol {
  color: #6fcf6f;
}

.btn-reset-note {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: #888;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
  align-self: center;
}

.btn-reset-note:hover {
  opacity: 1;
  color: #e05555;
}

/* ===== MODAL DÉTAIL FILM / SÉRIE ===== */
.film-card {
  cursor: pointer;
}

.modal-detail-box {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #333 #111;
}

.modal-detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #444;
  color: #aaa;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}

.modal-detail-close:hover {
  background: #333;
  color: #fff;
}

.modal-detail-content {
  display: flex;
  align-items: stretch;
}

.modal-detail-left {
  flex-shrink: 0;
  width: 230px;
}

.modal-detail-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px 0 0 0;
  min-height: 300px;
}

.modal-detail-poster-placeholder {
  width: 100%;
  min-height: 300px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border-radius: 16px 0 0 0;
}

.modal-detail-right {
  flex: 1;
  padding: 1.75rem 1.75rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.modal-detail-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-detail-titre {
  font-size: 1.65rem;
  font-weight: 700;
  color: #f0ede6;
  line-height: 1.2;
  font-family: 'Playfair Display', serif;
  margin: 0;
}

.modal-detail-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  color: #aaa;
  font-size: 0.88rem;
}

.modal-detail-meta .sep {
  color: #444;
  user-select: none;
}

.modal-detail-meta .film-genre {
  background: #222;
  color: #bbb;
  border-radius: 6px;
}

.modal-detail-people {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid #222;
}

.detail-people-row {
  font-size: 0.84rem;
  color: #bbb;
  line-height: 1.5;
}

.detail-role {
  color: #555;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.5rem;
}

.modal-detail-synopsis {
  font-size: 0.88rem;
  color: #aaa;
  line-height: 1.65;
  border-top: 1px solid #222;
  padding-top: 0.65rem;
  margin: 0;
}

.modal-detail-commentaire {
  font-size: 0.84rem;
  color: #777;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
  padding-left: 0.75rem;
  border-left: 2px solid #333;
}

.modal-detail-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-detail-edit {
  background: #0f2a0f;
  border: 1px solid #39d353;
  color: #39d353;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-detail-edit:hover {
  background: #1a4a1a;
}

.modal-detail-trailer {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid #1e1e1e;
  margin-top: 0.25rem;
}

.modal-detail-trailer-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  padding: 0.9rem 0 0.6rem;
}

.modal-detail-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: none;
  display: block;
}

.strap-btn {
  background: #1a2a1a;
  color: #556655;
  border: 1px solid #2a3a2a;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  height: 2.5rem;
}
.strap-btn.active {
  background: #80cc80;
  color: #0a0f0a;
  border-color: #80cc80;
  font-weight: bold;
}
.strap-desc {
  text-align: center;
  font-size: 0.75rem;
  color: #6a7a8a;
  margin-bottom: 0.6rem;
  letter-spacing: 0.03rem;
}
.strap-status {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: #80cc80;
  letter-spacing: 0.05rem;
}

@media (max-width: 640px) {
  .modal-detail-content {
    flex-direction: column;
  }
  .modal-detail-left {
    width: 100%;
  }
  .modal-detail-poster {
    border-radius: 16px 16px 0 0;
    max-height: 260px;
    min-height: unset;
    object-position: top;
  }
  .modal-detail-poster-placeholder {
    border-radius: 16px 16px 0 0;
    min-height: 180px;
  }
  .modal-detail-right {
    padding: 1.25rem;
  }
  .modal-detail-titre {
    font-size: 1.3rem;
  }
}

/* ==============================
   MOBILE — Dashboard & Header
   ============================== */
@media (max-width: 600px) {
  .dashboard-container {
    padding: 1.25rem 1rem;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  header h1 {
    font-size: 1.25rem;
  }

  header .subtitle {
    font-size: 0.88rem;
  }

  header > div {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
  }

  #logoutBtn {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
  }

  /* Archive button — plus discret sur mobile */
  .archive-btn {
    bottom: 0.75rem;
    right: 0.75rem;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    color: #4a4a4a !important;
    -webkit-tap-highlight-color: transparent;
  }
}