/* Thèmes Hub — mêmes palettes que les modules */
:root,
[data-theme="gcm"] {
  --hub-50: #fff7f3;
  --hub-100: #ffede4;
  --hub-200: #ffd4bf;
  --hub-500: #e85a2a;
  --hub-600: #d65427;
  --hub-700: #bf4520;
  --hub-800: #9a3619;
  --hub-900: #6b2410;
  --hub-bg: #f4f6f8;
  --hub-shadow-hover: rgba(214, 84, 39, 0.15);
}

[data-theme="lmf-blue"] {
  --hub-50: #eef4fb;
  --hub-100: #d5e4f5;
  --hub-200: #b3cce8;
  --hub-500: #2563a8;
  --hub-600: #1e4d8c;
  --hub-700: #1e3a5f;
  --hub-800: #152a45;
  --hub-900: #0f1f33;
  --hub-bg: #f1f5f9;
  --hub-shadow-hover: rgba(30, 58, 95, 0.15);
}

[data-theme="forest"] {
  --hub-50: #ecfdf5;
  --hub-100: #d1fae5;
  --hub-200: #a7f3d0;
  --hub-500: #059669;
  --hub-600: #047857;
  --hub-700: #065f46;
  --hub-800: #064e3b;
  --hub-900: #022c22;
  --hub-bg: #f0fdf4;
  --hub-shadow-hover: rgba(6, 95, 70, 0.15);
}

[data-theme="indigo"] {
  --hub-50: #eef2ff;
  --hub-100: #e0e7ff;
  --hub-200: #c7d2fe;
  --hub-500: #6366f1;
  --hub-600: #4f46e5;
  --hub-700: #4338ca;
  --hub-800: #3730a3;
  --hub-900: #312e81;
  --hub-bg: #f8fafc;
  --hub-shadow-hover: rgba(67, 56, 202, 0.15);
}

[data-theme="slate"] {
  --hub-50: #f8fafc;
  --hub-100: #e2e8f0;
  --hub-200: #cbd5e1;
  --hub-500: #64748b;
  --hub-600: #475569;
  --hub-700: #334155;
  --hub-800: #1e293b;
  --hub-900: #0f172a;
  --hub-bg: #f1f5f9;
  --hub-shadow-hover: rgba(51, 65, 85, 0.15);
}

:root {
  --card-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
 body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--hub-bg);
  color: #1e293b;
  min-height: 100vh;
}

/* Écran de chargement — le contenu du Hub reste masqué jusqu'à la confirmation de session */
.hub-auth-pending {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--hub-bg);
}
.hub-auth-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 3px solid rgba(100, 116, 139, 0.18);
  border-top-color: var(--hub-600);
  animation: hub-spinner 0.8s linear infinite;
}
.hub-auth-pending p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}
@keyframes hub-spinner { to { transform: rotate(360deg); } }
body.auth-pending .hub-page-header,
body.auth-pending .modules,
body.auth-pending .hub-top-bar {
  visibility: hidden;
}
body.is-authenticated .hub-auth-pending { display: none; }

/* Fond photo — thème GCM uniquement */
html[data-theme="gcm"][data-hub-bg="photo"] body {
  background-color: #1a1512;
  background-image:
    linear-gradient(180deg, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0.38) 45%, rgba(26, 21, 18, 0.58) 100%),
    url("/static/gcm-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html[data-theme="gcm"][data-hub-bg="photo"] .hub-title,
html[data-theme="gcm"][data-hub-bg="photo"] .hub-subtitle,
html[data-theme="gcm"][data-hub-bg="photo"] .hub-meta,
html[data-theme="gcm"][data-hub-bg="photo"] .hub-meta a,
html[data-theme="gcm"][data-hub-bg="photo"] #hub-user-name {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
html[data-theme="gcm"][data-hub-bg="photo"] .hub-version,
html[data-theme="gcm"][data-hub-bg="photo"] .hub-credit {
  color: rgba(255, 255, 255, 0.92);
}
html[data-theme="gcm"][data-hub-bg="photo"] .hub-theme-label,
html[data-theme="gcm"][data-hub-bg="photo"] .hub-logout {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.55);
}
html[data-theme="gcm"][data-hub-bg="photo"] .module-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
}
html[data-theme="gcm"][data-hub-bg="photo"] .page-wrap {
  background: transparent;
}
html[data-theme="gcm"][data-hub-bg="photo"] .page-title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
html[data-theme="gcm"][data-hub-bg="photo"] .page-subtitle {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.theme-bg-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem 0.45rem;
  margin-top: 0.15rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}
.theme-bg-option[hidden] {
  display: none !important;
}
.theme-bg-option input {
  accent-color: var(--hub-600);
  cursor: pointer;
}
.mono { font-family: ui-monospace, monospace; }
.page-wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.back-link { margin-bottom: 1rem; }
.back-link a {
  font-size: 0.875rem;
  color: var(--hub-600);
  text-decoration: none;
}
.back-link a:hover { text-decoration: underline; }
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hub-700);
}
.page-subtitle {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #64748b;
}
.hub-page-header {
  width: 100%;
  max-width: 56rem;
  margin-bottom: 2.5rem;
}
.hub-header {
  text-align: center;
  max-width: 32rem;
  margin: 0 auto;
}
.hub-user-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #475569;
  flex-wrap: wrap;
}
#hub-user-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
}
.hub-theme-picker {
  position: relative;
}
.hub-theme-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--hub-700);
  cursor: default;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #fff;
  display: inline-block;
}
.hub-theme-picker:hover .hub-theme-label,
.hub-theme-picker:focus-within .hub-theme-label {
  border-color: var(--hub-600);
}
.hub-theme-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.35rem 0;
  min-width: 11rem;
  z-50;
}
.hub-theme-picker:hover .hub-theme-menu,
.hub-theme-picker:focus-within .hub-theme-menu {
  display: block;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.theme-option:hover {
  background: #f1f5f9;
}
.theme-option.is-active {
  background: var(--hub-50);
  color: var(--hub-800);
  font-weight: 600;
}
.theme-swatch {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.hub-logout {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--hub-600);
  text-decoration: none;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.45rem 1rem;
  background: #fff;
}
.hub-logout:hover {
  border-color: var(--hub-600);
}
body:not(.page-wrap) {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem 3rem;
}
.hub-logo {
  height: 3.5rem;
  width: auto;
  margin-bottom: 1rem;
}
.hub-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hub-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hub-subtitle {
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.95rem;
}
.hub-meta {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}
.hub-version {
  font-family: ui-monospace, monospace;
  color: var(--hub-600);
  text-decoration: none;
}
.hub-version:hover { text-decoration: underline; }
.hub-credit { color: #94a3b8; margin-left: 0.4rem; }
.hub-tm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.15rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.42rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.15em;
  color: #94a3b8;
}
.modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 62rem;
}
@media (max-width: 50rem) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 32rem) {
  .modules {
    grid-template-columns: 1fr;
  }
}
.module-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem 1.25rem 1.1rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 12.25rem;
  height: 100%;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.module-card.active {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.module-card.active:hover {
  border-color: var(--hub-600);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--hub-shadow-hover);
}
.module-card.disabled,
.module-card[data-no-access="1"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.module-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hub-700);
  line-height: 1.3;
  min-height: 2.6em;
  text-align: center;
}
.module-name::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0.85rem auto 0;
  background: var(--hub-600);
  border-radius: 1px;
}
.module-desc {
  font-size: 0.85rem;
  color: #64748b;
  flex: 1;
  min-height: 2.6em;
}
.module-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}
.module-card > .module-badge,
.module-card > .module-badges {
  margin-top: auto;
}
.badge-open {
  background: var(--hub-50);
  color: var(--hub-700);
  border: 1px solid var(--hub-200);
}
.badge-soon {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}
.module-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}
.module-stat {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #475569;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  white-space: normal;
  line-height: 1.35;
  max-width: 100%;
}
.module-alerts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}
.module-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.4;
}
.module-alert-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: #f97316;
  flex-shrink: 0;
}
.hub-footer {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}
.hub-access-notice {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #b45309;
  text-align: center;
}
.changelog-entries { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.changelog-entry {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.changelog-entry--current {
  border-color: var(--hub-600);
  box-shadow: 0 0 0 2px var(--hub-shadow-hover);
}
.changelog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.changelog-version {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--hub-700);
}
.changelog-date { font-size: 0.75rem; color: #94a3b8; }
.changelog-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--hub-50);
  color: var(--hub-700);
  border: 1px solid var(--hub-200);
}
.changelog-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.changelog-list {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: #475569;
}
.changelog-list li + li { margin-top: 0.25rem; }

.hub-top-bar {
  width: 100%;
  max-width: 56rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.hub-top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.hub-top-bar .hub-user-bar {
  margin-bottom: 0;
  margin-left: auto;
}
.hub-feedback-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  padding: 0.28rem 0.55rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.hub-feedback-link:hover {
  color: var(--hub-700);
  border-color: #e2e8f0;
  background: rgba(255, 255, 255, 0.65);
}
.hub-feedback-link-current {
  color: var(--hub-700);
  cursor: default;
}
.hub-feedback-rainbow {
  font-weight: 600;
  border-color: rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0.45rem rgba(255, 255, 255, 0.35);
}
.hub-feedback-rainbow-char {
  display: inline-block;
  animation: hub-feedback-rainbow 2.8s linear infinite;
  animation-delay: calc(var(--i, 0) * 0.09s);
}
@keyframes hub-feedback-rainbow {
  0% { color: #ef4444; text-shadow: 0 0 0.35rem rgba(239, 68, 68, 0.45); }
  16% { color: #f97316; text-shadow: 0 0 0.35rem rgba(249, 115, 22, 0.45); }
  33% { color: #eab308; text-shadow: 0 0 0.35rem rgba(234, 179, 8, 0.45); }
  50% { color: #22c55e; text-shadow: 0 0 0.35rem rgba(34, 197, 94, 0.45); }
  66% { color: #3b82f6; text-shadow: 0 0 0.35rem rgba(59, 130, 246, 0.45); }
  83% { color: #a855f7; text-shadow: 0 0 0.35rem rgba(168, 85, 247, 0.45); }
  100% { color: #ef4444; text-shadow: 0 0 0.35rem rgba(239, 68, 68, 0.45); }
}
.feedback-page {
  padding: 1.25rem 1rem 2.5rem;
}
.feedback-main {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}
.feedback-page .feedback-admin-section-wide {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}
.feedback-intro {
  margin-bottom: 1.25rem;
}
.feedback-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.feedback-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hub-800);
  margin-bottom: 0.85rem;
}
.feedback-form {
  display: grid;
  gap: 0.85rem;
}
.feedback-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.3rem;
}
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
}
.feedback-field textarea {
  resize: vertical;
  min-height: 6rem;
}
.feedback-submit {
  justify-self: start;
  background: var(--hub-700);
  color: #fff;
  border: none;
  border-radius: 0.55rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.feedback-submit:hover {
  background: var(--hub-800);
}
.feedback-page-error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.88rem;
}
.feedback-form-error {
  color: #b45309;
  font-size: 0.85rem;
}
.feedback-form-success {
  color: #047857;
  font-size: 0.85rem;
}
.feedback-list {
  display: grid;
  gap: 0.75rem;
}
.feedback-empty {
  font-size: 0.88rem;
  color: #94a3b8;
}
.feedback-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
}
.feedback-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
}
.feedback-item-module {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--hub-700);
}
.feedback-item-type {
  font-size: 0.75rem;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}
.feedback-status {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.12rem 0.5rem;
}
.feedback-status-pending {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
.feedback-status-approved {
  color: #047857;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}
.feedback-status-rejected {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
.feedback-approved-date {
  font-weight: 500;
  opacity: 0.9;
}
.feedback-item-comment {
  font-size: 0.9rem;
  color: #334155;
  white-space: pre-wrap;
  margin-bottom: 0.35rem;
}
.feedback-item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}
.feedback-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.feedback-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.feedback-year-group {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
}
.feedback-year-group + .feedback-year-group {
  margin-top: 0.65rem;
}
.feedback-year-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #334155;
  transition: background 0.15s;
}
.feedback-year-toggle:hover {
  background: #f1f5f9;
}
.feedback-year-arrow {
  font-size: 0.72rem;
  color: var(--hub-700);
  width: 1rem;
  flex-shrink: 0;
  text-align: center;
}
.feedback-year-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--hub-700);
}
.feedback-year-count {
  font-size: 0.78rem;
  color: #64748b;
  margin-left: auto;
}
.feedback-year-items {
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
}
.feedback-year-group:not(.is-open) .feedback-year-items {
  display: none;
}
.feedback-admin-list {
  display: grid;
  gap: 0;
}
.feedback-btn {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.45rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.feedback-btn-approve {
  color: #047857;
  background: #ecfdf5;
  border-color: #6ee7b7;
}
.feedback-btn-reject {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}
.feedback-btn-delete {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.feedback-btn-dismiss {
  color: #475569;
  background: #fff;
  border-color: #cbd5e1;
}
.feedback-btn-dismiss:hover {
  background: #f8fafc;
}
