/* ============================================
   REUSABLE COMPONENTS
   ============================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: var(--color-primary-50);
  color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-100); }

.btn-accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}
.btn-accent:hover { background: var(--color-accent-dark); }

.btn-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
}
.btn-danger:hover { background: var(--color-danger); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
}
.btn-ghost:hover { background: var(--color-bg-hover); color: var(--color-text); }

.btn-icon {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--color-bg-hover); color: var(--color-text); }

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

/* Contextual action bar inside the task modal (mark done / delete / & open wedding) */
.task-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}
.btn.task-action-done {
  background: var(--color-success, #2e7d4f);
  color: #fff;
  border: none;
}
.btn.task-action-done:hover { filter: brightness(1.06); }

/* ---- Cards ---- */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: var(--space-5) var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-100);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237A6E66' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary { background: var(--color-primary-100); color: var(--color-primary-dark); }
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: #E65100; }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-info { background: var(--color-info-light); color: var(--color-info); }
.badge-muted { background: var(--color-bg-hover); color: var(--color-text-muted); }

/* ---- Priority badges ---- */
.priority-critical { background: var(--color-priority-critical); color: white; }
.priority-high { background: var(--color-priority-high); color: white; }
.priority-medium { background: var(--color-priority-medium); color: white; }
.priority-low { background: var(--color-priority-low); color: white; }
.priority-none { background: var(--color-priority-none); color: white; }

/* ---- Progress bar ---- */
.progress-bar {
  height: 8px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.progress-bar-fill.success { background: var(--color-success); }
.progress-bar-fill.warning { background: var(--color-warning); }
.progress-bar-fill.danger { background: var(--color-danger); }

/* ---- Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-primary-50);
  color: var(--color-primary);
}

.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.tag-remove:hover { opacity: 1; }

/* ---- Tables ---- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg-hover); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: var(--space-6);
  position: relative;
}

.tabs-wrapper {
  position: relative;
}

/* ---- Mobile tab grid ---- */
.tab-grid-mobile {
  display: none;
}

@media (max-width: 768px) {
  .tabs-desktop-only { display: none; }
  .tab-grid-mobile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    padding: var(--space-2);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
  }
  .tab-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-3) var(--space-1);
    border: none;
    background: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-muted);
  }
  .tab-grid-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .tab-grid-item span {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
  }
  .tab-grid-item small {
    font-weight: 400;
    opacity: 0.7;
  }
  .tab-grid-item:active {
    transform: scale(0.95);
  }
  .tab-grid-item.active {
    background: var(--color-primary-50);
    color: var(--color-primary);
  }
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.tab:hover { color: var(--color-text); }
.tab:hover svg { opacity: 1; }

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab.active svg { opacity: 1; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  margin-bottom: var(--space-6);
}

/* ---- Search bar ---- */
.search-bar {
  position: relative;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--color-bg-card);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-100);
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ---- Avatar ---- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-100);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }

/* ---- Stat card ---- */
.stat-card {
  padding: var(--space-5) var(--space-6);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-1);
}

/* ---- File upload ---- */
.file-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-upload:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
}

.file-upload input {
  display: none;
}

.file-upload-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* ---- Donut chart (CSS only) ---- */
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center {
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--color-bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center .amount {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
}

.donut-center .label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- Section headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

/* ---- Grid layouts ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

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

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-primary-50) 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8) var(--space-6);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-light);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--color-primary);
  margin-top: var(--space-2);
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.auth-plan-badge {
  display: inline-block;
  background: var(--color-primary-50);
  color: var(--color-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-primary-100);
}

.auth-error {
  background: #FFF5F5;
  color: var(--color-danger);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  border: 1px solid #FFCDD2;
}

/* Badge cadenas option payante (modale modules) — surface le gating plan */
.org-module-lock {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FBE7C8, #F3D9A8);
  color: #8B6F2E;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  vertical-align: middle;
  white-space: nowrap;
}
.org-module-lock:hover { filter: brightness(0.96); }

/* ============================================
   C4 sécurité — Bannière mode hors ligne (lecture seule)
   ============================================ */
.wp-offline-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #B4231F, #8B1A17);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.25);
}
.wp-offline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #FFD2CE; flex-shrink: 0;
  animation: wpOfflinePulse 1.6s ease-in-out infinite;
}
@keyframes wpOfflinePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.wp-offline-text { flex: 1; line-height: 1.4; }
.wp-offline-text strong { font-weight: 700; }
.wp-offline-retry {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.wp-offline-retry:hover { background: rgba(255, 255, 255, 0.28); }
/* Laisse de la place pour la barre fixe en bas. */
body.wp-offline { padding-bottom: 52px; }
/* Indice visuel lecture-seule : le bouton flottant de création est désactivé.
   L'enforcement réel se fait dans API._fetch (toast au save). */
body.wp-offline #fab,
body.wp-offline .fab,
body.wp-offline .dash-topbar-actions .ed-btn-primary {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.5);
}
@media (max-width: 640px) {
  .wp-offline-banner { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; }
  body.wp-offline { padding-bottom: 84px; }
}

/* ============================================
   C (suite) — Bannière "connexion instable" (ambre, non bloquante)
   Distincte de la rouge : on PEUT encore écrire, on invite à sauvegarder.
   ============================================ */
.wp-unstable-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #B8791E, #9A6516);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.2);
}
.wp-unstable-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #FFE6B8; flex-shrink: 0;
  animation: wpOfflinePulse 1.6s ease-in-out infinite;
}
.wp-unstable-text { flex: 1; line-height: 1.4; }
.wp-unstable-text strong { font-weight: 700; }
.wp-unstable-save {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.wp-unstable-save:hover { background: rgba(255, 255, 255, 0.3); }
.wp-unstable-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.85;
}
.wp-unstable-close:hover { opacity: 1; }
body.wp-unstable { padding-bottom: 52px; }
@media (max-width: 640px) {
  .wp-unstable-banner { flex-wrap: wrap; text-align: left; }
  body.wp-unstable { padding-bottom: 84px; }
}

/* ============================================
   D — Indicateur de synchro (chip discret)
   ============================================ */
.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 0 0 16px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e7e0d6);
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text-secondary, #6b6257);
}
.sync-status.is-embedded { margin: 0 0 18px; }
.sync-status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex-shrink: 0;
}
.sync-status-dot.is-ok  { background: #3F9E69; box-shadow: 0 0 0 3px rgba(63, 158, 105, 0.15); }
.sync-status-dot.is-off { background: #B4665C; box-shadow: 0 0 0 3px rgba(180, 102, 92, 0.15); }
.sync-status-text { flex: 1; line-height: 1.3; }
.sync-status-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--color-border, #e7e0d6);
  color: var(--color-primary, #8B6F4E);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.sync-status-btn:hover:not(:disabled) { background: var(--color-surface-muted, #f6f1e9); }
.sync-status-btn:disabled { opacity: 0.5; cursor: default; }

/* ============================================
   A — Guide de sauvegarde (modale d'aide)
   ============================================ */
.backup-guide-h {
  font-family: var(--font-heading, Georgia, serif);
  font-size: 1.05rem;
  color: var(--color-primary, #8B6F4E);
  margin: 18px 0 6px;
}
.backup-guide p { line-height: 1.5; margin: 0 0 10px; }
.backup-guide-list,
.backup-guide-steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.55; }
.backup-guide-list li,
.backup-guide-steps li { margin-bottom: 6px; }
.backup-guide-note {
  background: var(--color-surface-muted, #f6f1e9);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================
   C3 sécurité — Bannière "Pack Jour J" (mariage imminent)
   ============================================ */
.jjp-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #FDF0E3, #FBE3D0);
  border: 1px solid #E0B97A;
  border-left: 4px solid #B5694B;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: var(--space-4, 18px);
}
.jjp-banner-icon { font-size: 30px; flex-shrink: 0; }
.jjp-banner-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jjp-banner-body strong { color: #1A1614; font-size: 15px; }
.jjp-banner-body span { color: #5a4634; font-size: 13px; line-height: 1.4; }
@media (max-width: 640px) {
  .jjp-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ============================================
   C2 sécurité — Bannière de rappel de sauvegarde (nag)
   ============================================ */
.export-nag-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #FFF8E1, #FFFBEF);
  border: 1px solid #E0B97A;
  border-left: 4px solid var(--joy-gold-ink, #B8965A);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: var(--space-5, 24px);
}
.export-nag-icon { font-size: 28px; flex-shrink: 0; }
.export-nag-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.export-nag-body strong { color: #1A1614; font-size: 15px; }
.export-nag-body span { color: #5a4634; font-size: 13px; line-height: 1.4; }
.export-nag-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 640px) {
  .export-nag-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .export-nag-actions { justify-content: center; }
}

/* ============================================
   C1 légal — Modale BLOQUANTE de re-acceptation CGU
   ============================================ */
.cgu-blocking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 20, 0.78);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: cguFadeIn 0.2s ease-out;
}
@keyframes cguFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cgu-blocking-modal {
  background: #FFFFFF;
  max-width: 580px;
  width: 100%;
  border-radius: 14px;
  padding: 32px 36px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.cgu-blocking-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 12px;
}
.cgu-blocking-modal h2 {
  margin: 0 0 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  text-align: center;
  color: #1A1614;
  font-weight: 500;
}
.cgu-blocking-lead {
  text-align: center;
  color: #5a4634;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
}
.cgu-blocking-highlights {
  background: #FBF8F3;
  border: 1px solid #EAD9CE;
  border-left: 4px solid var(--joy-gold-ink, #B8965A);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1A1614;
  line-height: 1.5;
}
.cgu-blocking-highlights p { margin: 0 0 6px; }
.cgu-blocking-highlights ul {
  margin: 0;
  padding-left: 22px;
}
.cgu-blocking-highlights li { margin-bottom: 4px; }
.cgu-blocking-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 14px 0 18px;
  font-size: 13px;
}
.cgu-blocking-links a {
  color: var(--joy-gold-ink, #B8965A);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cgu-blocking-links a:hover { color: #1A1614; }
.cgu-blocking-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(184, 150, 90, 0.06);
  border: 1px solid rgba(184, 150, 90, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: #1A1614;
  margin-bottom: 16px;
}
.cgu-blocking-check input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--joy-gold-ink, #B8965A);
}
.cgu-blocking-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cgu-blocking-actions .btn { min-width: 200px; }
@media (max-width: 540px) {
  .cgu-blocking-modal { padding: 22px 20px; }
  .cgu-blocking-actions { flex-direction: column-reverse; }
  .cgu-blocking-actions .btn { width: 100%; }
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  font-size: var(--text-sm);
}

.auth-links a {
  color: var(--color-primary);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-links span {
  color: var(--color-text-muted);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--color-primary);
}

.auth-footer span {
  color: var(--color-text-muted);
}

/* Code input */
.code-input {
  text-align: center;
  font-size: var(--text-2xl) !important;
  letter-spacing: 0.3em;
  font-family: 'Courier New', monospace;
}

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-label {
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   SIDEBAR FOOTER (Account + Logout)
   ============================================ */

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.account-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-text-sidebar);
  font-size: var(--text-sm);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(255,255,255,0.08);
  color: #FFCDD2;
}

/* Auth page: hide sidebar & header */
.auth-page ~ .sidebar,
.auth-page ~ .mobile-header {
  display: none;
}

/* ============ EDIT LOCK OVERLAY ============ */
.lock-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.lock-overlay-card {
  max-width: 420px;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(139,111,94,0.06), rgba(139,111,94,0.02));
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.lock-overlay-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139,111,94,0.28);
}
.lock-overlay-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.lock-overlay-text {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  line-height: 1.55;
}
.lock-overlay-text strong { color: var(--color-primary); }

/* Small inline badge shown on list-row items while the corresponding bloc is locked. */
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139,111,94,0.12);
  color: var(--color-primary);
  font-weight: 500;
  vertical-align: middle;
}
.lock-badge svg { width: 12px; height: 12px; }

/* ============================================================
   BACKUP & RESTAURATION — modale (js/utils/backup.js)
   ============================================================ */
.bk-modal { padding: var(--space-4); }
.bk-actions { margin-bottom: var(--space-4); }
.bk-h {
  font-family: var(--serif, Georgia, serif);
  font-size: 15px; font-weight: 600; color: var(--ink, #2A2520);
  margin: var(--space-4) 0 var(--space-2);
}
.bk-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 32px 16px; color: var(--muted, #8a7f72);
}
.bk-empty svg { opacity: 0.5; }
.bk-snaps { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow-y: auto; }
.bk-snap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line, #E5D9D0);
  border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
.bk-snap:hover { border-color: var(--muted-soft, #C9B5A5); }
.bk-snap.is-selected { border-color: var(--primary, #8B6F5E); background: color-mix(in srgb, var(--primary, #8B6F5E) 6%, transparent); }
.bk-snap input[type="radio"] { flex-shrink: 0; accent-color: var(--primary, #8B6F5E); }
.bk-snap-main { flex: 1; min-width: 0; }
.bk-snap-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-snap-date { font-weight: 600; font-size: 13px; color: var(--ink, #2A2520); }
.bk-snap-size { font-size: 11px; color: var(--muted, #8a7f72); margin-left: auto; }
.bk-snap-sum { font-size: 11.5px; color: var(--muted, #8a7f72); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.bk-badge-manual { background: var(--joy-sage-tint, #E7EDE1); color: var(--joy-sage-ink, #5f7050); }
.bk-badge-auto { background: var(--joy-sky-tint, #E1EAF0); color: var(--joy-sky-ink, #4a6b82); }
.bk-snap-del { flex-shrink: 0; color: var(--muted, #8a7f72); }
.bk-snap-del:hover { color: var(--joy-rose-ink, #b4665c); }
.bk-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 520px) { .bk-cats { grid-template-columns: 1fr; } }
.bk-cat {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--line, #E5D9D0);
  border-radius: 10px; cursor: pointer; font-size: 13px;
}
.bk-cat input { accent-color: var(--primary, #8B6F5E); }
.bk-cat-ico { color: var(--muted, #8a7f72); display: inline-flex; }
.bk-cat-label { flex: 1; color: var(--ink, #2A2520); }
.bk-cat-count { font-size: 11px; font-weight: 700; color: var(--muted, #8a7f72); background: var(--surface-tinted, #F5F0EB); padding: 1px 8px; border-radius: 999px; }
.bk-cat.is-empty { opacity: 0.5; cursor: not-allowed; }
.bk-restore-bar { margin-top: var(--space-4); display: flex; justify-content: flex-end; }

/* ============================================================
   LIVE GALLERY — cockpit hôte (js/components/wedding-gallery.js)
   ============================================================ */
.gal-tab { padding: 4px 0 8px; }
.gal-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.gal-head-actions { display:flex; gap:8px; flex-wrap:wrap; }
.gal-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
@media (max-width:640px){ .gal-kpis{ grid-template-columns:repeat(2,1fr); } }
.gal-kpi { background:var(--surface-tinted,#F5F0EB); border-radius:12px; padding:12px 14px; }
.gal-kpi-val { font-family:var(--serif,Georgia,serif); font-size:26px; line-height:1; color:var(--ink,#2A2520); }
.gal-kpi-lbl { font-size:11.5px; color:var(--muted,#8a7f72); margin-top:6px; display:flex; align-items:center; gap:5px; }
.gal-kpi.is-warn .gal-kpi-val { color:var(--joy-rose-ink,#B4665C); }
.gal-share { display:flex; gap:16px; background:var(--surface,#fff); border:1px solid var(--line,#E5D9D0); border-radius:14px; padding:14px; margin-bottom:18px; align-items:center; }
@media (max-width:560px){ .gal-share{ flex-direction:column; align-items:stretch; } }
.gal-qr { width:120px; height:120px; flex-shrink:0; background:#fff; border:1px solid var(--line,#E5D9D0); border-radius:10px; padding:6px; }
.gal-qr svg { display:block; width:100%; height:100%; }
.gal-share-body { flex:1; min-width:0; }
.gal-share-title { font-size:13px; font-weight:600; color:var(--ink,#2A2520); margin-bottom:8px; }
.gal-link { display:flex; gap:8px; margin-bottom:10px; }
.gal-link input { flex:1; min-width:0; font-family:var(--mono,monospace); font-size:12px; padding:8px 10px; border:1px solid var(--line,#E5D9D0); border-radius:8px; background:var(--surface-tinted,#FBF8F3); color:var(--ink,#2A2520); }
.gal-share-actions { display:flex; gap:8px; flex-wrap:wrap; }
.gal-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; }
.gal-tile { position:relative; aspect-ratio:1; border-radius:12px; overflow:hidden; background:var(--surface-tinted,#F5F0EB); border:1px solid var(--line,#E5D9D0); transition:transform .18s ease, box-shadow .18s ease; animation:galTileIn .4s cubic-bezier(.2,.7,.3,1) both; }
.gal-tile:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(26,22,20,.14); }
@keyframes galTileIn { from{ opacity:0; transform:scale(.94) } to{ opacity:1; transform:none } }
@media(prefers-reduced-motion:reduce){ .gal-tile{ animation:none } }
.gal-tile img { width:100%; height:100%; object-fit:cover; display:block; }
.gal-tile.is-hidden { opacity:.45; }
.gal-tile.is-hidden::after { content:'Masquée'; position:absolute; top:6px; left:6px; font-size:10px; background:rgba(26,22,20,.7); color:#fff; padding:1px 7px; border-radius:20px; }
/* En attente de validation (modération d'abord) */
.gal-tile.is-pending { border:2px dashed var(--joy-gold-ink,#B8965A); }
.gal-tile.is-pending img { filter:brightness(.94) saturate(.96); }
.gal-tile-badge { position:absolute; top:6px; left:6px; z-index:2; display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:700; background:var(--joy-gold-ink,#B8965A); color:#fff; padding:2px 8px; border-radius:20px; }
.gal-tile.is-pending .gal-tile-actions { opacity:1; } /* toujours visibles pour valider vite */
.gal-tile-actions .gal-approve { background:var(--joy-sage-ink,#7A8D6B); color:#fff; }
.gal-tile-actions .gal-approve:hover { background:var(--joy-sage-ink,#6b7d5e); filter:brightness(1.05); }
.gal-tile-vid { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:var(--muted,#8a7f72); }
.gal-tile-guest { position:absolute; bottom:6px; left:6px; font-size:10px; background:rgba(26,22,20,.55); color:#fff; padding:2px 8px; border-radius:20px; max-width:80%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gal-tile-actions { position:absolute; top:6px; right:6px; display:flex; gap:4px; opacity:0; transition:opacity .15s; }
.gal-tile:hover .gal-tile-actions { opacity:1; }
.gal-tile-actions button { width:28px; height:28px; border-radius:8px; border:none; background:rgba(255,255,255,.9); color:var(--ink,#2A2520); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.gal-tile-actions button:last-child:hover { color:var(--joy-rose-ink,#B4665C); }
.gal-grid-empty { grid-column:1/-1; text-align:center; padding:30px 16px; color:var(--muted,#8a7f72); }
.gal-grid-empty svg { opacity:.5; margin-bottom:8px; }
.gal-empty { text-align:center; max-width:460px; margin:24px auto; padding:32px 20px; }
.gal-empty-ico { color:var(--gold-ink,#8E6E3A); margin-bottom:12px; }
.gal-empty-title { font-family:var(--serif,Georgia,serif); font-size:24px; font-weight:500; margin:0 0 8px; }
.gal-empty-sub { font-size:14px; color:var(--muted,#8a7f72); line-height:1.6; margin:0 0 16px; }
.gal-empty-pricing { margin-bottom:18px; }
.gal-badge { font-size:12px; padding:5px 12px; border-radius:999px; display:inline-flex; align-items:center; gap:5px; }
.gal-badge-free { background:var(--joy-sage-tint,#E7EDE1); color:var(--joy-sage-ink,#5f7050); }
.gal-badge-addon { background:var(--joy-gold-tint,#F3E9D2); color:var(--gold-ink,#8E6E3A); }
.gal-wall { position:fixed; inset:0; z-index:10000; background:#0F0C0A; overflow:hidden; }
/* Fond flou (crossfade) — remplit l'écran derrière la photo nette */
.gal-wall-bg { position:absolute; inset:-9%; background-size:cover; background-position:center;
  filter:blur(36px) brightness(.42) saturate(1.12); transform:scale(1.08); opacity:0; transition:opacity 1.1s ease; }
.gal-wall-bg.on { opacity:1; }
/* Photo nette (crossfade + Ken Burns) */
.gal-wall-img { position:absolute; inset:0; margin:auto; max-width:88vw; max-height:80vh; width:auto; height:auto;
  object-fit:contain; border-radius:6px; opacity:0; transition:opacity 1.1s ease; box-shadow:0 30px 90px rgba(0,0,0,.55); }
.gal-wall-img.on { opacity:1; }
.gal-wall-img.kb { animation:gw-kenburns 6s ease-out both; }
@keyframes gw-kenburns { from{ transform:scale(1.02) } to{ transform:scale(1.11) } }
.gal-wall-couple { position:absolute; top:26px; left:0; right:0; text-align:center; z-index:2;
  font-family:var(--serif,Georgia,serif); font-size:26px; color:#F3E9D2; letter-spacing:.04em; text-shadow:0 2px 12px rgba(0,0,0,.55); }
.gal-wall-cap { position:absolute; bottom:34px; left:0; right:0; text-align:center; z-index:2;
  font-size:14.5px; color:#F3E9D2; letter-spacing:.02em; text-shadow:0 2px 10px rgba(0,0,0,.6); transition:opacity .5s; }
.gal-wall-count { position:absolute; bottom:34px; right:26px; z-index:2;
  font-family:var(--mono,monospace); font-size:12px; color:rgba(255,255,255,.55); letter-spacing:.12em; }
.gal-wall-progress { position:absolute; left:0; right:0; bottom:0; height:3px; background:rgba(255,255,255,.12); z-index:2; }
.gal-wall-progress i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--joy-gold-ink,#B8965A),var(--joy-rose-ink,#B4665C)); }
.gal-wall-close { position:absolute; top:18px; right:18px; width:40px; height:40px; border-radius:50%; border:none; background:rgba(255,255,255,.12); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; z-index:3; transition:background .2s; }
.gal-wall-close:hover { background:rgba(255,255,255,.22); }
@media(prefers-reduced-motion:reduce){ .gal-wall-img.kb{ animation:none; } }
