/* =====================================================
   VINCULUM — Feuille de styles principale
   Esthétique : luxe sombre / cuir / or / latin
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,600&family=Raleway:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,500&display=swap');

/* ── Variables ─────────────────────────────────────── */
:root {
  --bg-deep:        #070707;
  --bg-primary:     #0d0d0d;
  --bg-secondary:   #131313;
  --bg-card:        #181616;
  --bg-card-hover:  #1d1b1b;
  --bg-input:       #101010;

  --crimson:        #9b1b1b;
  --crimson-light:  #c0392b;
  --crimson-bright: #e74c3c;
  --crimson-dark:   #6b0f0f;
  --crimson-glow:   rgba(155, 27, 27, 0.38);

  --gold:           #c9a84c;
  --gold-light:     #e8c97a;
  --gold-pale:      #f0dfa0;
  --gold-dark:      #8a7030;
  --gold-glow:      rgba(201, 168, 76, 0.22);

  --text-bright:    #f0ebe4;
  --text-primary:   #d5ccc0;
  --text-secondary: #8a7d72;
  --text-muted:     #4a4038;

  --border:         #222020;
  --border-light:   #302828;
  --border-gold:    rgba(201, 168, 76, 0.28);
  --border-crimson: rgba(155, 27, 27, 0.4);

  --sidebar-w:      265px;
  --topbar-h:       62px;
  --radius:         5px;
  --radius-lg:      10px;
  --radius-xl:      16px;

  --transition:     0.25s ease;
  --shadow-card:    0 6px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-r:  0 0 24px var(--crimson-glow);
  --shadow-glow-g:  0 0 18px var(--gold-glow);
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 15px;
}

/* Noise texture subtile */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--crimson-dark); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--crimson); }

/* ──────────────────────────────────────────────────────
   PAGE DE CONNEXION
   ────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(100, 10, 10, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(80, 8, 8, 0.15) 0%, transparent 60%),
    var(--bg-deep);
  padding: 1.5rem;
}

.login-card {
  background: linear-gradient(145deg, #191414, #111010);
  border: 1px solid var(--border-light);
  border-top: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(100, 0, 0, 0.12);
  animation: cardAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold), var(--gold-dark), transparent);
}

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

/* Logo */
.login-logo { text-align: center; margin-bottom: 1.8rem; }

.logo-icon-wrap {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: radial-gradient(circle, rgba(155,27,27,0.15), transparent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px rgba(155,27,27,0.2);
}

.logo-icon-wrap i { font-size: 1.8rem; color: var(--crimson-light); }

.logo-main {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.logo-main span { color: var(--gold); }

.logo-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

/* Diviseur ornemental */
.ornament-line {
  display: flex; align-items: center; gap: 0.8rem;
  margin: 1.5rem 0;
}
.ornament-line::before,
.ornament-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold));
}
.ornament-line::after {
  background: linear-gradient(90deg, var(--border-gold), transparent);
}
.ornament-line span {
  color: var(--gold-dark);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

/* Inputs login */
.field-group {
  position: relative;
  margin-bottom: 1.1rem;
}

.field-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
  transition: color var(--transition);
}

.field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  padding: 0.8rem 2.8rem 0.8rem 2.6rem;
  transition: var(--transition);
  outline: none;
}

.field-input::placeholder { color: var(--text-muted); }

.field-input:focus {
  border-color: var(--gold-dark);
  background: #0e0e0e;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08), inset 0 0 0 1px rgba(201,168,76,0.05);
  color: var(--text-bright);
}

.field-input:focus + .field-icon,
.field-group:focus-within .field-icon { color: var(--gold-dark); }

.field-toggle {
  position: absolute;
  right: 0.9rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color var(--transition);
  padding: 0.3rem;
}
.field-toggle:hover { color: var(--gold); }

/* Boutons */
.btn-crimson {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: linear-gradient(135deg, var(--crimson-dark), var(--crimson));
  border: 1px solid rgba(155,27,27,0.6);
  color: var(--text-bright);
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.82rem 1.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;     /* overridable avec style="width:auto" */
  max-width: 100%; /* jamais plus large que son parent */
  outline: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.btn-crimson::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn-crimson:hover {
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  box-shadow: var(--shadow-glow-r);
  transform: translateY(-1px);
}
.btn-crimson:hover::before { opacity: 1; }
.btn-crimson:active { transform: translateY(0); }

.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.btn-gold:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: var(--shadow-glow-g);
}

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.btn-ghost:hover {
  border-color: var(--border-crimson);
  color: var(--text-primary);
}

.btn-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
}
.btn-icon:hover { border-color: var(--gold-dark); color: var(--gold); }

.login-note {
  text-align: center;
  margin-top: 1.8rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.05em;
  line-height: 1.8;
}

/* ──────────────────────────────────────────────────────
   LAYOUT PRINCIPAL (sidebar + topbar + contenu)
   ────────────────────────────────────────────────────── */

.layout { display: flex; flex-direction: row; min-height: 100vh; width: 100%; }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100svh;
  background: linear-gradient(180deg, #0c0a0a 0%, #0a0909 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Ligne déco gauche de la sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(155,27,27,0.3), rgba(201,168,76,0.15), rgba(155,27,27,0.3), transparent);
}

.sidebar-header {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(155,27,27,0.3), rgba(155,27,27,0.1));
  border: 1px solid rgba(155,27,27,0.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon i { color: var(--crimson-light); font-size: 1rem; }

.brand-text { line-height: 1.1; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  color: var(--text-bright);
}
.brand-name span { color: var(--gold); }
.brand-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* Role badge */
.sidebar-role {
  margin: 0.9rem 1.4rem 0.4rem;
}
.role-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.role-badge.master {
  background: rgba(155,27,27,0.15);
  border: 1px solid rgba(155,27,27,0.35);
  color: #e07060;
}
.role-badge.sub {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
}
.role-badge i { font-size: 0.6rem; }

/* Navigation */
.sidebar-nav { flex: 1; padding: 0.5rem 0; overflow-y: auto; }

.nav-section-label {
  padding: 1rem 1.4rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-item { padding: 0 0.7rem; margin-bottom: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  letter-spacing: 0.02em;
}

.nav-link:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(155,27,27,0.18), rgba(155,27,27,0.05));
  color: var(--text-bright);
  border-left: 2px solid var(--crimson);
  padding-left: calc(0.9rem - 2px);
}
.nav-link.active .nav-icon { color: var(--crimson-light); }

.nav-icon {
  width: 18px; text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.nav-link:hover .nav-icon { color: var(--text-secondary); }

.nav-badge {
  margin-left: auto;
  background: var(--crimson-dark);
  color: #ffcccc;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Profil en bas de la sidebar */
.sidebar-footer {
  padding: 1rem 1.2rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar-user:hover { background: rgba(255,255,255,0.03); }

.user-avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--crimson-dark), #2a1010);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
  font-size: 1rem;
}

.user-info-sm { flex: 1; min-width: 0; }
.user-name-sm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-status-sm {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.user-status-sm .dot-online {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2ecc71;
  margin-right: 3px;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 1001;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.topbar-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.05em;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.topbar-title small {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-style: normal;
  margin-top: -2px;
}

.topbar-spacer { flex: 1; }

.topbar-date {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  display: none;
}
@media (min-width: 768px) { .topbar-date { display: block; } }

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
}
.notif-btn:hover { border-color: var(--gold-dark); color: var(--gold); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--crimson-light);
  border: 1.5px solid var(--bg-primary);
}
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 10px;
  background: var(--crimson);
  color: #fff;
  font-size: 0.62rem; font-weight: 700; font-family: 'Raleway', sans-serif;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-primary);
  pointer-events: none;
}

/* ── Panneau notifications ─────────────────────────── */
.notif-panel {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 320px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  overflow: hidden;
  flex-direction: column;
  animation: fadeIn .15s ease both;
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  font-family: 'Playfair Display', serif;
  font-size: .85rem; font-weight: 600;
  color: var(--text-bright);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-count {
  background: var(--crimson);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.notif-list {
  overflow-y: auto;
  flex: 1;
}
.notif-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item-title {
  font-size: .78rem; font-weight: 600;
  color: var(--text-bright);
  margin-bottom: .15rem;
}
.notif-item-body {
  font-size: .73rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: .3rem;
}
.notif-item-time {
  font-size: .65rem;
  color: var(--text-muted);
  font-style: italic;
}
.notif-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 2rem 1rem;
  color: var(--text-muted); font-size: .8rem; font-style: italic;
}
.notif-empty i { font-size: 1.3rem; opacity: .5; }

.notif-perm-banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  background: rgba(201,168,76,.07);
  border-bottom: 1px solid rgba(201,168,76,.15);
  font-size: .75rem; color: var(--text-secondary);
  flex-shrink: 0;
}
.notif-perm-banner i { color: var(--gold-dark); font-size: .9rem; flex-shrink: 0; }
.notif-perm-banner div { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.notif-perm-banner > div > div:first-child { font-weight: 600; color: var(--text-bright); font-size: .76rem; }
.notif-perm-banner small { font-size: .68rem; color: var(--text-muted); line-height: 1.3; }
.notif-perm-warn { background: rgba(155,27,27,.07); border-bottom-color: rgba(155,27,27,.2); }
.notif-perm-warn i { color: var(--crimson); }
.notif-perm-btn {
  margin-top: .3rem; align-self: flex-start;
  padding: .25rem .65rem;
  background: var(--crimson); color: #fff; border: none; border-radius: 4px;
  font-size: .68rem; font-weight: 600; font-family: 'Raleway', sans-serif;
  cursor: pointer; transition: var(--transition);
}
.notif-perm-btn:hover { background: var(--crimson-light); }

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-gold);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #2a1010, var(--crimson-dark));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── Main content ────────────────────────────────────── */
.main-content {
  flex: 1;           /* remplit toute la largeur restante dans .layout flex */
  min-width: 0;      /* empêche le contenu de faire déborder le flex item   */
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 1.8rem 2rem;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Cartes ─────────────────────────────────────────── */

/* Variante carte fond crimson (remplace les inline styles) */
.card-v-crimson {
  background: linear-gradient(145deg, #181212, #141010);
  border-color: var(--border-crimson) !important;
}

/* Panneau formulaire Maître (data-master-only) */
.panel-master {
  background: linear-gradient(145deg, #181212, #141010);
  border: 1px solid var(--border-crimson);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1rem;
}

[data-theme="light"] .card-v-crimson {
  background: linear-gradient(145deg, #fff0ee, #fde8e5);
}
[data-theme="light"] .panel-master {
  background: linear-gradient(145deg, #fff5f3, #fdf0ed);
  border-color: rgba(155,27,27,0.25);
}

.card-v {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card-v:hover { border-color: var(--border-light); }

.card-v-glow {
  background: linear-gradient(145deg, #1a1010, #181515);
  border: 1px solid var(--border-crimson);
  border-top: 1px solid rgba(155,27,27,0.25);
}
.card-v-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(155,27,27,0.06), transparent);
  pointer-events: none;
}

.card-v-gold {
  background: linear-gradient(145deg, #191610, #171510);
  border: 1px solid var(--border-gold);
  border-top: 1px solid rgba(201,168,76,0.2);
}

.card-header-v {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.card-title-v {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
}
.card-subtitle-v {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Icône de carte */
.card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.card-icon-crimson {
  background: rgba(155,27,27,0.15);
  border: 1px solid rgba(155,27,27,0.3);
  color: var(--crimson-light);
}
.card-icon-gold {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
}
.card-icon-muted {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Ordre du jour (hero card) */
.order-hero {
  background: linear-gradient(135deg, #160c0c, #1a1010, #160e0e);
  border: 1px solid rgba(155,27,27,0.45);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.order-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 0% 50%, rgba(155,27,27,0.12), transparent),
    radial-gradient(ellipse 40% 60% at 100% 50%, rgba(100,0,0,0.08), transparent);
  pointer-events: none;
}
.order-hero-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--crimson-light);
  margin-bottom: 0.6rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.order-hero-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(155,27,27,0.4), transparent);
}
.order-hero-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-bright);
  line-height: 1.6;
  margin-bottom: 1.2rem;
  position: relative;
}
.order-hero-text::before {
  content: '"';
  font-size: 3rem;
  color: rgba(155,27,27,0.2);
  position: absolute;
  top: -0.8rem; left: -0.5rem;
  font-family: 'Playfair Display', serif;
  line-height: 1;
}
.order-hero-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.8rem;
}
.order-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.order-meta i { color: var(--crimson-dark); }

/* Stats widgets */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-value.crimson { color: var(--crimson-light); }
.stat-value.gold { color: var(--gold); }
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-icon {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

/* Progress bar */
.progress-v {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-v-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--crimson-dark), var(--crimson-light));
  transition: width 0.6s ease;
}
.progress-v-bar.gold {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

/* Checklist (routines) */
.check-item {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: var(--transition);
}
.check-item:last-child { border-bottom: none; }

.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: var(--transition);
}
.check-box:hover { border-color: var(--gold-dark); }
.check-box.checked {
  background: rgba(155,27,27,0.2);
  border-color: var(--crimson);
  color: var(--crimson-light);
  font-size: 0.6rem;
}

.check-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.check-text.done { color: var(--text-muted); text-decoration: line-through; }
.check-time {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}

/* Tags / Badges */
.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tag-crimson { background: rgba(155,27,27,0.18); border: 1px solid rgba(155,27,27,0.35); color: #e07060; }
.tag-gold    { background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3);  color: var(--gold-light); }
.tag-green   { background: rgba(46,204,113,0.1);  border: 1px solid rgba(46,204,113,0.25); color: #68e09a; }
.tag-muted   { background: rgba(255,255,255,0.04);border: 1px solid var(--border);         color: var(--text-secondary); }

/* Difficulty dots */
.difficulty { display: inline-flex; align-items: center; gap: 3px; }
.diff-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-light);
}
.diff-dot.filled { background: var(--crimson); }
.diff-dot.gold.filled { background: var(--gold); }

/* Challenge card */
.challenge-card {
  border-left: 3px solid var(--crimson);
  padding-left: 1rem;
  margin-bottom: 0.8rem;
}
.challenge-card.completed { border-left-color: #2ecc71; opacity: 0.6; }
.challenge-card.pending   { border-left-color: var(--gold); }

/* Galerie grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}
.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--bg-card);
}
.gallery-item:hover { border-color: var(--border-gold); transform: scale(1.02); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex; align-items: flex-end;
  padding: 0.6rem;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-label { font-size: 0.65rem; color: var(--text-primary); }

/* Section title */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 1rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light), transparent);
}
.section-title i { color: var(--crimson-dark); font-size: 0.8rem; }

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover {
  border-color: var(--gold-dark);
  background: rgba(201,168,76,0.03);
}
.upload-zone i { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 0.6rem; display: block; }
.upload-zone p { font-size: 0.8rem; color: var(--text-secondary); }
.upload-zone small { font-size: 0.7rem; color: var(--text-muted); }

/* Form inputs (autres pages) */
.form-v label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.input-v {
  width: 100%;
  max-width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}
/* Quand input-v est dans un field-group (icône à gauche), conserver le padding-left */
.field-group .input-v { padding-left: 2.6rem; }
/* Quand il y a aussi un toggle œil à droite */
.field-group .input-v[type="password"],
.field-group .input-v.has-toggle { padding-right: 2.8rem; }
.input-v::placeholder { color: var(--text-muted); }
.input-v:focus {
  border-color: var(--gold-dark);
  background: #0d0d0d;
  color: var(--text-bright);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.07);
}
textarea.input-v { resize: vertical; min-height: 100px; }
select.input-v { cursor: pointer; }

.form-v .mb-f { margin-bottom: 1.1rem; }

/* Divider */
.divider-v {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
  margin: 1.5rem 0;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Activity feed */
.feed-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.feed-dot.crimson { background: var(--crimson); box-shadow: 0 0 6px var(--crimson-glow); }
.feed-dot.gold    { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }
.feed-dot.muted   { background: var(--text-muted); }
.feed-content { flex: 1; }
.feed-text { font-size: 0.83rem; color: var(--text-primary); line-height: 1.4; }
.feed-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; font-style: italic; font-family: 'Cormorant Garamond', serif; }

/* ── Responsive ─────────────────────────────────────── */

/* Fix global */
html, body { overflow-x: hidden; }
.topbar-title     { min-width: 0; flex-shrink: 1; overflow: hidden; }
.topbar-title > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-content     { overflow-x: hidden; }
.layout           { overflow-x: hidden; }

/* ── Tablette + mobile (< 1200px) : sidebar en tiroir ── */
@media (max-width: 1199px) {
  /* Sidebar : cachée par défaut, glisse depuis la gauche */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    /* svh = hauteur viewport garantie (barre d'adresse visible incluse) */
    height: 100vh;
    height: 100svh;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0,0,0,0.7);
  }

  /* Overlay : couvre le contenu, SOUS la topbar (z-index 999 < topbar 1001) */
  .sidebar-overlay {
    top: 0; left: 0; right: 0; bottom: 0;
  }
  .sidebar-overlay.open { display: block; }

  /* Topbar : couvre toute la largeur */
  .topbar { left: 0; }
  .topbar-toggle { display: flex; align-items: center; justify-content: center; }

  .main-content { margin-left: 0; }
}

/* ── Mobile (< 768px) ── */
@media (max-width: 768px) {
  /* Topbar : réduit légèrement */
  :root { --topbar-h: 56px; }
  .topbar { padding: 0 1rem; gap: 0.75rem; }
  .topbar-date { display: none !important; }

  /* Cibles tactiles : minimum 44px (guidelines Apple/Google) */
  .topbar-toggle,
  .notif-btn,
  .theme-toggle { width: 42px; height: 42px; }
  .nav-link { min-height: 44px; padding: 0 1rem; }

  /* Panneau notifs : pleine largeur sur mobile */
  .notif-panel {
    width: calc(100vw - 1.5rem) !important;
    right: 0.75rem !important;
    left: 0.75rem !important;
    max-height: 70vh;
  }

  /* Cards */
  .card-v, .card-v-glow, .card-v-gold { padding: 1rem; }

  /* Hero ordre */
  .order-hero-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .order-hero-footer > div { width: 100%; }
  .order-hero-footer > div.d-flex { flex-wrap: wrap; justify-content: flex-start; }
  .order-hero-footer .btn-crimson,
  .order-hero-footer .btn-gold { flex: 1; min-width: 110px; }
  .order-hero-text  { font-size: 1.05rem; }
  .order-hero-label { font-size: 0.6rem; }
}

/* ── Petit mobile (< 576px) ── */
@media (max-width: 576px) {
  .main-content { padding: 1rem 0.85rem; }
  .order-hero   { padding: 1.1rem; }

  /* Stat cards */
  .stat-value { font-size: 1.6rem; }
  .stat-card  { padding: 0.85rem 0.65rem; }
  .col-4 .stat-card  { padding: 0.65rem 0.45rem; }
  .col-4 .stat-value { font-size: 1.35rem; }
  .col-4 .stat-icon  { font-size: 0.95rem; margin-bottom: 0.35rem; }
  .col-4 .stat-label { font-size: 0.58rem; }

  /* Galerie */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  /* Bande semaine scrollable */
  .week-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .week-strip::-webkit-scrollbar { display: none; }
  .week-strip > * { min-width: 40px; flex-shrink: 0; }

  /* Tags */
  .tag { font-size: 0.58rem; padding: 0.12rem 0.4rem; }

  /* Défis */
  .chall-foot { flex-direction: column; align-items: stretch; }
  .chall-foot > .d-flex { flex-wrap: wrap; }

  /* Ordres footer */
  .d-flex.justify-content-between.flex-wrap { gap: 0.5rem; }

  /* Sidebar footer : réduit */
  .sidebar-footer { padding: 0.75rem 1rem; }
  .user-avatar-sm { width: 30px; height: 30px; font-size: 0.75rem; }
}

/* ── Très petit mobile (< 380px) ── */
@media (max-width: 380px) {
  :root { --topbar-h: 52px; }
  .main-content { padding: 0.75rem 0.65rem; }
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  .topbar-title  { font-size: 0.9rem; }
  .brand-name    { font-size: 0.95rem; letter-spacing: 0.1em; }
  .topbar-toggle,
  .notif-btn,
  .theme-toggle  { width: 36px; height: 36px; font-size: 0.8rem; }
  /* Stats : 2 par ligne */
  #statsRow > div { flex: 0 0 50%; max-width: 50%; }
}

/* ── Page header ────────────────────────────────────── */
.page-header {
  margin-bottom: 1.8rem;
}
.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.page-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

/* ── Miscellaneous ──────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-crimson { color: var(--crimson-light); }
.text-muted-v { color: var(--text-muted); }
.text-italic-serif { font-family: 'Cormorant Garamond', serif; font-style: italic; }

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }

.list-none { list-style: none; padding: 0; }

/* ── Empty states ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-icon {
  font-size: 2rem; margin-bottom: 0.8rem;
  color: var(--text-muted); opacity: 0.4;
}
.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; font-style: italic;
  color: var(--text-secondary); margin-bottom: 0.3rem;
}
.empty-sub {
  font-size: 0.78rem; font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  color: var(--text-muted);
}

/* ── Error shake ─────────────────────────────────── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

.field-input.error { border-color: var(--crimson) !important; }
.field-error { font-size: 0.72rem; color: var(--crimson-light); margin-top: 0.3rem; display: none; }
.field-error.show { display: block; }

/* Spin animation for loader */
@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.4s ease both; }

/* ── Popup félicitations ─────────────────────────────── */
#congratOverlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fadeIn .25s ease both;
}
.congrat-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.congrat-card {
  position: relative; z-index: 1;
  background: linear-gradient(145deg, #0e0606 0%, #130a0a 60%, #0d0a12 100%);
  border: 1px solid rgba(201,168,76,.45);
  border-radius: var(--radius-xl);
  padding: 2.8rem 2.2rem 2.2rem;
  max-width: 460px; width: 100%;
  text-align: center;
  box-shadow: 0 0 80px rgba(155,27,27,.2), inset 0 0 40px rgba(201,168,76,.03), 0 24px 80px rgba(0,0,0,.6);
  animation: congratIn .4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.congrat-deco {
  color: var(--gold);
  font-size: .85rem;
  letter-spacing: .6em;
  opacity: .6;
  margin-bottom: 1.4rem;
}
.congrat-phrase {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-style: italic;
  color: var(--text-bright);
  line-height: 1.65;
  margin-bottom: 2rem;
}
.congrat-close {
  background: none;
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold-dark);
  border-radius: var(--radius);
  padding: .5rem 1.8rem;
  font-family: 'Raleway', sans-serif;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; transition: var(--transition);
}
.congrat-close:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,.05); }
@keyframes congratIn {
  from { transform: scale(.8) translateY(20px); opacity: 0; }
  to   { transform: scale(1)  translateY(0);    opacity: 1; }
}

/* Pulse crimson */
@keyframes pulseCrimson {
  0%, 100% { box-shadow: 0 0 0 0 var(--crimson-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}
.pulse-crimson { animation: pulseCrimson 2.5s ease infinite; }

/* ══════════════════════════════════════════════════════
   BOUTON TOGGLE THÈME
   ══════════════════════════════════════════════════════ */

.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.82rem;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--gold-dark); color: var(--gold); }

/* Bouton flottant sur la page login */
.theme-toggle-login {
  position: fixed; top: 1rem; right: 1rem;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
  z-index: 100;
}
.theme-toggle-login:hover { color: var(--gold); border-color: var(--gold-dark); }

/* ══════════════════════════════════════════════════════
   THÈME CLAIR  [data-theme="light"]
   ══════════════════════════════════════════════════════ */

[data-theme="light"] {
  /* Fonds */
  --bg-deep:        #ede3d8;
  --bg-primary:     #f5ede3;
  --bg-secondary:   #ece0d3;
  --bg-card:        #fdf8f2;
  --bg-card-hover:  #fffaf5;
  --bg-input:       #f0e6da;

  /* Texte */
  --text-bright:    #160808;
  --text-primary:   #3a1e1e;
  --text-secondary: #7a4a3a;
  --text-muted:     #b08070;

  /* Bordures */
  --border:         #ddd0c0;
  --border-light:   #cfbfaa;
  --border-gold:    rgba(160, 124, 40, 0.40);
  --border-crimson: rgba(140,  20, 20, 0.28);

  /* Or légèrement désaturé */
  --gold:           #a07828;
  --gold-light:     #c49030;
  --gold-pale:      #ddb860;
  --gold-dark:      #785018;
  --gold-glow:      rgba(160, 120, 40, 0.18);

  /* Ombres */
  --shadow-card:    0 2px 20px rgba(0,0,0,0.10);
  --shadow-glow-r:  0 0 20px rgba(155,27,27,0.18);
  --shadow-glow-g:  0 0 15px rgba(160,120,40,0.15);
  --crimson-glow:   rgba(155, 27, 27, 0.18);
}

/* ── Corps ─────────────────────────────────────────── */
[data-theme="light"] body { background-color: var(--bg-primary); }
[data-theme="light"] body::after { opacity: 0.012; }

/* ── Sidebar ────────────────────────────────────────── */
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #f0e8dc 0%, #ebe0d2 100%);
  border-right-color: var(--border);
}
[data-theme="light"] .sidebar::after {
  background: linear-gradient(180deg, transparent, rgba(155,27,27,0.2), rgba(160,120,40,0.1), rgba(155,27,27,0.2), transparent);
}
[data-theme="light"] .sidebar-header { border-bottom-color: var(--border); }
[data-theme="light"] .sidebar-footer  { border-top-color:    var(--border); }
[data-theme="light"] .brand-name       { color: var(--text-bright); }
[data-theme="light"] .brand-sub        { color: var(--text-muted);  }
[data-theme="light"] .nav-section-label { color: var(--text-muted); }
[data-theme="light"] .nav-link         { color: var(--text-secondary); }
[data-theme="light"] .nav-link:hover   { background: rgba(0,0,0,0.04); color: var(--text-primary); }
[data-theme="light"] .nav-link.active  {
  background: linear-gradient(90deg, rgba(155,27,27,0.12), rgba(155,27,27,0.03));
  color: var(--text-bright);
}
[data-theme="light"] .nav-icon         { color: var(--text-muted); }
[data-theme="light"] .user-name-sm     { color: var(--text-primary); }
[data-theme="light"] .user-status-sm   { color: var(--text-muted); }
[data-theme="light"] .sidebar-user:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .sidebar-overlay  { background: rgba(0,0,0,0.4); }

/* ── Topbar ────────────────────────────────────────── */
[data-theme="light"] .topbar {
  background: rgba(245, 237, 228, 0.94);
  border-bottom-color: var(--border);
}
[data-theme="light"] .topbar-toggle:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .notif-btn { border-color: var(--border); }
[data-theme="light"] .notif-btn:hover { border-color: var(--gold-dark); background: rgba(0,0,0,0.03); }
[data-theme="light"] .notif-panel { background: #fff; box-shadow: 0 8px 40px rgba(0,0,0,.15); }
[data-theme="light"] .notif-item:hover { background: rgba(0,0,0,.02); }

/* ── Cartes ────────────────────────────────────────── */
[data-theme="light"] .card-v { box-shadow: 0 2px 18px rgba(0,0,0,0.07); }
[data-theme="light"] .card-v:hover { box-shadow: 0 4px 28px rgba(0,0,0,0.10); }

[data-theme="light"] .card-v-glow {
  background: linear-gradient(145deg, #fff0ee, #fde8e5);
  border-color: rgba(155,27,27,0.22);
  border-top-color: rgba(155,27,27,0.12);
}
[data-theme="light"] .card-v-glow::before {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(155,27,27,0.04), transparent);
}
[data-theme="light"] .card-v-gold {
  background: linear-gradient(145deg, #fff8ee, #fdf3e0);
  border-color: rgba(160,120,40,0.28);
  border-top-color: rgba(160,120,40,0.15);
}

/* ── Hero ordre ────────────────────────────────────── */
[data-theme="light"] .order-hero {
  background: linear-gradient(135deg, #fff0ee, #fde8e5, #ffeced);
  border-color: rgba(155,27,27,0.32);
}
[data-theme="light"] .order-hero::before {
  background:
    radial-gradient(ellipse 60% 80% at 0% 50%, rgba(155,27,27,0.06), transparent),
    radial-gradient(ellipse 40% 60% at 100% 50%, rgba(120,0,0,0.03), transparent);
}
[data-theme="light"] .order-hero-text::before { color: rgba(155,27,27,0.10); }

/* ── Progress bar ──────────────────────────────────── */
[data-theme="light"] .progress-v { background: rgba(0,0,0,0.08); }

/* ── Listes ────────────────────────────────────────── */
[data-theme="light"] .check-item  { border-bottom-color: rgba(0,0,0,0.05); }
[data-theme="light"] .check-box.checked { background: rgba(155,27,27,0.12); }
[data-theme="light"] .feed-item   { border-bottom-color: rgba(0,0,0,0.05); }

/* ── Inputs ────────────────────────────────────────── */
[data-theme="light"] .field-input { background: var(--bg-input); color: var(--text-primary); }
[data-theme="light"] .field-input:focus { background: #fff; }
[data-theme="light"] .input-v:focus { background: #fff; }

/* ── Scrollbar ─────────────────────────────────────── */
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-secondary); }

/* ── Titre de section ──────────────────────────────── */
[data-theme="light"] .section-title::after {
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ── Challenges ────────────────────────────────────── */
[data-theme="light"] .chall-head.active-bg   { background: linear-gradient(90deg,rgba(155,27,27,0.05),transparent); }
[data-theme="light"] .chall-head.upcoming-bg { background: linear-gradient(90deg,rgba(160,120,40,0.04),transparent); }
[data-theme="light"] .chall-foot { background: rgba(0,0,0,0.03); }

/* ── Routines ──────────────────────────────────────── */
[data-theme="light"] .routine-block-header {
  background: linear-gradient(90deg, rgba(160,120,40,0.05), transparent);
}

/* ── Galerie ───────────────────────────────────────── */
[data-theme="light"] .gal-add { background: rgba(160,120,40,0.03) !important; }
[data-theme="light"] .gal-add:hover { background: rgba(160,120,40,0.06) !important; }

/* ── Profil ────────────────────────────────────────── */
[data-theme="light"] .profile-banner::before {
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(155,27,27,0.12), transparent),
    radial-gradient(ellipse 40% 60% at 80% 30%, rgba(160,120,40,0.08), transparent) !important;
}

/* ── Page de connexion ─────────────────────────────── */
[data-theme="light"] .login-body {
  background:
    radial-gradient(ellipse 80% 60% at 50%   0%, rgba(180,60,60,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(160,50,50,0.07) 0%, transparent 60%),
    #f5ede3;
}
[data-theme="light"] .login-card {
  background: linear-gradient(155deg, #fdf8f2 0%, #faf4ec 100%);
  border-color: var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(155,27,27,0.06) inset;
}
[data-theme="light"] .login-card::before {
  background: linear-gradient(90deg, transparent, rgba(160,120,40,0.35), transparent);
}
[data-theme="light"] .blob-1 { opacity: 0.08; }
[data-theme="light"] .blob-2 { opacity: 0.06; }
[data-theme="light"] .blob-3 { opacity: 0.03; }

/* ── Avatars / topbar ──────────────────────────────── */
[data-theme="light"] .topbar-avatar {
  background: linear-gradient(135deg, rgba(155,27,27,0.15), rgba(155,27,27,0.05));
  border-color: var(--border-gold);
  color: var(--crimson);
}
[data-theme="light"] .user-avatar-sm {
  background: linear-gradient(135deg, rgba(155,27,27,0.15), rgba(155,27,27,0.05));
  border-color: var(--border-gold);
  color: var(--crimson);
}
[data-theme="light"] .brand-icon {
  background: linear-gradient(135deg, rgba(155,27,27,0.15), rgba(155,27,27,0.05));
  border-color: rgba(155,27,27,0.25);
}

/* ── Profil — banner et avatar ─────────────────────── */
[data-theme="light"] .profile-banner {
  background: linear-gradient(135deg, #f5ddd8 0%, #f0c8c0 30%, #f5d8e8 70%, #e8d8f0 100%) !important;
}
[data-theme="light"] .profile-avatar {
  background: linear-gradient(135deg, rgba(155,27,27,0.15), rgba(155,27,27,0.05)) !important;
  color: var(--crimson);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── Toggle login ──────────────────────────────────── */
[data-theme="light"] .theme-toggle-login {
  background: rgba(0,0,0,0.04);
  border-color: var(--border);
  color: var(--text-secondary);
}
