/* ============================================================
   MIMBA TTS — Prototype UI/UX (validation avant intégration)
   Direction "Indigo Océan" : fond clair, accents indigo/violet.
   ============================================================ */

:root {
  --bg: #fbfbfe;
  --bg-soft: #f3f3fb;
  --card: #ffffff;
  --ink: #15172b;
  --ink-soft: #4a4d6a;
  --muted: #767a96;
  --border: #e6e6f2;
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --indigo-soft: #eef0fd;
  --violet: #7c3aed;
  --sky: #38bdf8;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --shadow: 0 20px 50px -20px rgba(79, 70, 229, .25);
  --shadow-sm: 0 8px 24px -12px rgba(21, 23, 43, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --header-height: 72px;
  --sidebar-width: 248px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0e0f1c;
  --bg-soft: #15172b;
  --card: #1a1c30;
  --ink: #f3f3fb;
  --ink-soft: #c7c9e0;
  --muted: #8b8fb0;
  --border: #2a2c45;
  --indigo-soft: #211f45;
  --green-soft: #0e2a1c;
  --red-soft: #2a1414;
  --amber-soft: #2a2110;
}

/* ---- fond clair moins lumineux (alternative à un blanc pur) ---- */
[data-bg="soft"] {
  --bg: #f3f1ec;
  --bg-soft: #eae7df;
  --card: #faf8f3;
  --border: #e1ddd0;
}

/* ---- variantes de couleur d'accent (remplacent indigo/violet/sky) ---- */
[data-accent="green"] {
  --indigo: #059669; --indigo-dark: #047857; --violet: #0d9488; --sky: #34d399; --indigo-soft: #e7f7f0;
}
[data-accent="green"][data-theme="dark"] { --indigo-soft: #0d2820; }

[data-accent="violet"] {
  --indigo: #7c3aed; --indigo-dark: #5b21b6; --violet: #c026d3; --sky: #a78bfa; --indigo-soft: #f4eefe;
}
[data-accent="violet"][data-theme="dark"] { --indigo-soft: #2a1a47; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}
h1, h2, h3, h4 { font-family: "Sora", "Inter", sans-serif; font-weight: 700; letter-spacing: -.02em; margin: 0; }
p { margin: 0; color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea {font-family: inherit;color: inherit;background: var(--muted);}
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
section { position: relative; }
.hidden { display: none !important; }

/* ---- boutons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: 0 24px 50px -16px rgba(79, 70, 229, .45); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn-block { width: 100%; }

/* ---- formes organiques en arrière-plan ---- */
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0; pointer-events: none; }

/* ============================================================
   NAV / HEADER (landing)
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--header-height);
  background: rgba(251, 251, 254, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
}
[data-theme="dark"] .nav { background: rgba(14, 15, 28, .85); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 0rem; max-width: 1180px; margin: 0 auto; width: 100%; }
.nav-logo { display: flex; align-items: center; gap: .6rem; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.25rem; }
.nav-logo img { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 1rem; font-weight: 500; font-size: .92rem; color: var(--ink-soft); list-style: none; margin: 0; padding: 0; }
.nav-links a:hover { color: var(--indigo); }
.nav-actions { display: flex; align-items: center; gap: .7rem; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft);
}
.theme-toggle:hover { border-color: var(--indigo); color: var(--indigo); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }
.nav-mobile { display: none; flex-direction: column; gap: 1rem; padding: 1rem 1.5rem 1.2rem; border-top: 1px solid var(--border); background: var(--bg); }
.nav-mobile a { padding: .3rem 0; font-weight: 500; }
.nav-mobile.show { display: flex; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 4.5rem 0 5rem; overflow: hidden; }
.hero .blob.b1 { width: 480px; height: 480px; background: var(--indigo); top: -180px; right: -120px; }
.hero .blob.b2 { width: 380px; height: 380px; background: var(--sky); top: 120px; left: -160px; opacity: .3; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; background: var(--indigo-soft); color: var(--indigo-dark);
  font-size: .82rem; font-weight: 600; padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.2rem;
}
[data-theme="dark"] .eyebrow { color: #b4b0ff; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.1; margin-bottom: 1.1rem; }
.hero h1 .grad { background: linear-gradient(135deg, var(--indigo), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.08rem; max-width: 46ch; margin-bottom: 1.6rem; }
.hero-ctas { display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-note {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--green);
  background: var(--green-soft); padding: .5rem 1rem; border-radius: 999px;
}

/* ---- carrousel de cartes "audio démo" (horizontal scroll) ---- */
.hero-cards-scroll { position: relative; z-index: 1; }
.hero-cards-track {
  display: flex; gap: 1rem; overflow-x: hidden; scroll-snap-type: x mandatory; padding-bottom: .2rem;
}
.hero-cards-nav { display: flex; gap: .6rem; justify-content: center; margin-top: .9rem; }
.carousel-arrow {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft);
}
.carousel-arrow:hover { border-color: var(--indigo); color: var(--indigo); }
.carousel-arrow:disabled { opacity: .35; cursor: not-allowed; }
.hero-card {
  flex: 0 0 100%; width: 100%; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.3rem;
}
.hero-card-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.hero-card-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.hero-card-lang { margin-left: auto; font-size: .78rem; color: var(--muted); background: var(--bg-soft); padding: .25rem .6rem; border-radius: 999px; }
.hero-card-text { font-size: .9rem; color: var(--ink-soft); background: var(--bg-soft); border-radius: 12px; padding: .85rem .95rem; margin-bottom: 1rem; min-height: 64px; }
.wave { display: flex; align-items: center; gap: 3px; height: 36px; margin-bottom: .9rem; }
.wave span {
  display: block; width: 4px; border-radius: 3px; background: linear-gradient(180deg, var(--indigo), var(--sky));
  height: 30%;
}
.wave.playing span { animation: waveAnim 1s ease-in-out infinite; }
.wave span:nth-child(2) { animation-delay: .1s; } .wave span:nth-child(3) { animation-delay: .2s; }
.wave span:nth-child(4) { animation-delay: .3s; } .wave span:nth-child(5) { animation-delay: .15s; }
.wave span:nth-child(6) { animation-delay: .25s; } .wave span:nth-child(7) { animation-delay: .05s; }
@keyframes waveAnim { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.hero-card-play { display: flex; align-items: center; gap: .6rem; font-size: .84rem; color: var(--ink-soft); }
.play-btn {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; border: 0; cursor: pointer;
}
.play-btn:hover { filter: brightness(1.08); }

/* ============================================================
   SECTIONS GÉNÉRIQUES
   ============================================================ */
.section { padding: 5rem 0; }
.section-head { max-width: 640px; margin: 0 auto 2.8rem; text-align: center; }
.section-eyebrow { color: var(--indigo); font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .6rem; display: block; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .7rem; }
.section-head p { font-size: 1.02rem; }
.section-alt { background: var(--bg-soft); }

/* ---- Écoutez nos voix ---- */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.voice-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; transition: transform .15s, box-shadow .15s; }
.voice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.voice-card .voice-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.voice-lang { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.voice-flag { font-size: 1.2rem; }
.voice-badge { background: var(--indigo-soft); color: var(--indigo-dark); padding: .2rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
[data-theme="dark"] .voice-badge { color: #b4b0ff; }
.voice-text { font-size: .9rem; color: var(--ink-soft); margin-bottom: 1rem; padding: .8rem .9rem; background: var(--bg-soft); border-radius: 10px; border-left: 3px solid var(--indigo); }
.voice-play-row { display: flex; align-items: center; gap: .7rem; font-size: .84rem; color: var(--muted); }

/* ---- features ---- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.7rem; transition: transform .15s, box-shadow .15s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
[data-theme="dark"] .feature-icon { color: #b4b0ff; }
.feature-card h3 { font-size: 1.06rem; margin-bottom: .4rem; }
.feature-card p { font-size: .9rem; }

/* ---- pricing (landing + crédits app) ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; max-width: 960px; margin: 0 auto; }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; text-align: center; position: relative; transition: transform .15s; }
.price-card:hover { transform: translateY(-3px); }
.price-card.popular { border-color: var(--indigo); box-shadow: var(--shadow); }
.price-card .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; }
.price-card h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.price-amount { font-family: "Sora", sans-serif; font-size: 1.7rem; font-weight: 800; margin: .5rem 0; }
.price-amount span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.price-credits { font-size: .86rem; color: var(--muted); margin-bottom: 1.1rem; }
.pricing-note { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 1.5rem; }

/* ---- témoignages ---- */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.testimonial-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.stars { color: var(--amber); font-size: .9rem; margin-bottom: .8rem; }
.testimonial-card blockquote { margin: 0 0 1.1rem; font-size: .94rem; color: var(--ink-soft); font-style: italic; }
.t-author { display: flex; align-items: center; gap: .7rem; }
.t-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.t-name { font-weight: 600; font-size: .88rem; }
.t-role { font-size: .78rem; color: var(--muted); }

/* ---- CTA final (version simple, sans bloc coloré) ---- */
.cta-section { text-align: center; }
.cta-section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .7rem; }
.cta-section p { font-size: 1.05rem; margin-bottom: 1.8rem; }
.cta-form { display: flex; gap: .7rem; max-width: 460px; margin: 0 auto; }
.cta-form input { flex: 1; border-radius: 999px; }
.cta-form .btn { flex-shrink: 0; }
.cta-note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }
@media (max-width: 520px) { .cta-form { flex-direction: column; } }

/* ---- footer ---- */
.footer { padding: 3.2rem 0 2rem; border-top: 1px solid var(--border); margin-top: 3.5rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p { max-width: 32ch; font-size: .89rem; margin-top: .6rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.footer-social a:hover { border-color: var(--indigo); color: var(--indigo); }
.footer-cols { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .8rem; }
.footer-col a { display: block; font-size: .89rem; color: var(--ink-soft); margin-bottom: .5rem; }
.footer-col a:hover { color: var(--indigo); }
.footer-bottom { font-size: .82rem; color: var(--muted); text-align: center; border-top: 1px solid var(--border); padding-top: 1.5rem; }

/* ============================================================
   NOTIFICATION BANNER (annonces admin)
   ============================================================ */
.notif-banners { position: relative; z-index: 60; }
.notif-banner { display: flex; align-items: center; justify-content: center; gap: 1rem; background: var(--indigo-soft); color: var(--indigo-dark); padding: .6rem 2.6rem .6rem 1rem; border-bottom: 1px solid var(--border); position: relative; text-align: center; font-size: .88rem; font-weight: 500; }
[data-theme="dark"] .notif-banner { color: #cfcdff; }
.notif-banner .dismiss { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1.2rem; opacity: .6; }
.notif-banner .dismiss:hover { opacity: 1; }

/* ============================================================
   PAGE LOADER (transition entre vues)
   ============================================================ */
.page-loader {
  position: fixed; inset: 0; z-index: 9999; background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.page-loader.active { opacity: 1; pointer-events: all; }
.loader-mark { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--indigo), var(--violet)); display: flex; align-items: center; justify-content: center; animation: loaderPulse 1.1s ease-in-out infinite; }
.loader-mark svg { width: 26px; height: 26px; }
@keyframes loaderPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.85); opacity: .7; } }
.loader-bar { width: 140px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.loader-bar::after { content: ''; display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--indigo), var(--sky)); animation: loaderBar 1s ease-in-out infinite; }
@keyframes loaderBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* fondu d'entrée pour chaque vue affichée */
.view-content, .admin-view { animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   AUTH (login / register) — vue dédiée
   ============================================================ */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; position: relative; overflow: hidden; }
.auth-shell .blob.b1 { width: 420px; height: 420px; background: var(--indigo); top: -140px; left: -140px; }
.auth-shell .blob.b2 { width: 360px; height: 360px; background: var(--sky); bottom: -160px; right: -120px; opacity: .3; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.2rem 2rem; }
.auth-card .nav-logo { justify-content: center; margin-bottom: 1.6rem; }
.auth-card h2 { text-align: center; font-size: 1.4rem; margin-bottom: .3rem; }
.auth-sub { text-align: center; font-size: .9rem; margin-bottom: 1.6rem; }
.auth-tabs { display: flex; background: var(--bg-soft); border-radius: 999px; padding: .25rem; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; text-align: center; padding: .55rem; border-radius: 999px; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--muted); }
.auth-tab.active { background: var(--card); color: var(--indigo); box-shadow: var(--shadow-sm); }
.auth-foot { text-align: center; margin-top: 1.3rem; font-size: .88rem; color: var(--muted); }
.auth-foot a { color: var(--indigo); font-weight: 600; }
.auth-back { position: fixed; top: 1.5rem; left: 1.5rem; z-index: 2; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label, .form-label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea,
.input, select.input, textarea.input {
  width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--ink); font-size: .92rem; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--indigo); }
.field textarea, textarea.input { resize: vertical; min-height: 90px; font-family: inherit; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--ink-soft); }

/* ---- sélecteur de thème (nuance + intensité du fond) ---- */
.swatch-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.swatch-btn { display: flex; flex-direction: column; align-items: center; gap: .4rem; background: none; border: 0; cursor: pointer; padding: .3rem; }
.swatch-dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.swatch-btn.active .swatch-dot { border-color: var(--ink); transform: scale(1.08); }
.swatch-btn span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.swatch-btn.active span { color: var(--ink); }
.swatch-dot.sw-indigo { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.swatch-dot.sw-green { background: linear-gradient(135deg, #059669, #0d9488); }
.swatch-dot.sw-violet { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.swatch-dot.sw-bright { background: #ffffff; border-color: var(--border) !important; }
.swatch-dot.sw-soft { background: #f3f1ec; border-color: var(--border) !important; }
.swatch-btn.active .swatch-dot.sw-bright, .swatch-btn.active .swatch-dot.sw-soft { border-color: var(--ink) !important; }

/* ============================================================
   APP LAYOUT (dashboard utilisateur)
   ============================================================ */
.app-layout, .admin-layout { display: none; min-height: 100vh; }
.app-layout.active, .admin-layout.active { display: flex; }

.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.3rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: .6rem; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.1rem; padding: 0 .6rem; margin-bottom: 1.6rem; }
.sidebar-logo img { width: 28px; height: 28px; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar-nav a.active { background: var(--indigo-soft); color: var(--indigo); font-weight: 700; }
[data-theme="dark"] .sidebar-nav a.active { color: #cfcdff; }
.sidebar-divider { border-top: 1px solid var(--border); margin: .8rem .4rem; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 1.8rem; border-bottom: 1px solid var(--border); background: var(--card); position: sticky; top: 0; z-index: 10; }
.app-topbar h2 { font-size: 1.2rem; }
.topbar-actions { display: flex; align-items: center; gap: .8rem; }
.credits-pill { display: flex; align-items: center; gap: .5rem; background: var(--indigo-soft); color: var(--indigo-dark); font-weight: 700; font-size: .88rem; padding: .5rem 1rem; border-radius: 999px; }
[data-theme="dark"] .credits-pill { color: #cfcdff; }
.app-content { padding: 1.8rem; flex: 1; }
.app-content > .view-content { display: none; }
.app-content > .view-content.active { display: block; }

/* ============================================================
   CARTES / SECTIONS génériques (réglages, blocs admin...)
   ============================================================ */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.3rem; }
.panel h3 { font-size: 1.02rem; display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.panel h3 svg { width: 18px; height: 18px; color: var(--indigo); }
.panel-hint { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.panel-row:first-of-type { border-top: 0; }
.row-label { font-weight: 600; font-size: .9rem; }
.row-desc { font-size: .82rem; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.stat-box .num { font-family: "Sora", sans-serif; font-size: 1.7rem; font-weight: 800; }
.stat-box .lbl { font-size: .83rem; color: var(--muted); margin-top: .2rem; }
.stat-box .trend { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; font-weight: 700; margin-top: .4rem; }
.trend.up { color: var(--green); } .trend.down { color: var(--red); }

/* ---- interrupteur ---- */
.toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.toggle.on { background: var(--indigo); }
.toggle.on .knob { transform: translateX(18px); }

/* ---- badges de statut ---- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo-dark); }
[data-theme="dark"] .badge-indigo { color: #cfcdff; }
.badge-muted { background: var(--bg-soft); color: var(--muted); }

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-toolbar { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.table-toolbar input, .table-toolbar select { padding: .6rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); font-size: .86rem; }
.table-toolbar input { flex: 1; min-width: 180px; }
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data-table th { text-align: left; padding: .8rem 1rem; background: var(--bg-soft); color: var(--muted); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
table.data-table td { padding: .8rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: var(--bg-soft); }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.mini-btn { padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--ink-soft); }
.mini-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft); }
.icon-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.icon-btn svg { width: 14px; height: 14px; }

/* ============================================================
   STUDIO — synthèse + lecteur personnalisé (inspiré gemini)
   ============================================================ */
.studio-grid { display: grid; grid-template-columns: 280px 1fr; gap: 1.3rem; align-items: start; }
.textarea-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.char-counter { font-size: .82rem; color: var(--muted); font-weight: 600; }
.char-counter strong { color: var(--indigo); }
.studio-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; flex-wrap: wrap; gap: .8rem; }
.cost-estimate { font-size: .86rem; color: var(--ink-soft); }
.cost-estimate strong { color: var(--indigo); }

.progress-box { margin-top: 1.2rem; }
.progress-info { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-soft); margin-bottom: .4rem; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--indigo), var(--sky)); border-radius: 999px; transition: width .25s ease; width: 0%; }

/* --- Animation d'inférence indéterminée (equalizer) --- */
.progress-label { text-align: center; font-size: .86rem; color: var(--ink-soft); margin-bottom: .8rem; font-weight: 500; letter-spacing: .02em; }
.equalizer { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 36px; }
.equalizer span { display: inline-block; width: 5px; border-radius: 999px; background: linear-gradient(to top, var(--indigo), var(--sky)); animation: eq-bounce 1.4s infinite ease-in-out both; transform-origin: bottom; }
.equalizer span:nth-child(1) { height: 16px; animation-delay: -0.4s; }
.equalizer span:nth-child(2) { height: 24px; animation-delay: -0.3s; }
.equalizer span:nth-child(3) { height: 36px; animation-delay: -0.2s; }
.equalizer span:nth-child(4) { height: 24px; animation-delay: -0.1s; }
.equalizer span:nth-child(5) { height: 16px; animation-delay: 0s; }
@keyframes eq-bounce { 0%,100%{ transform: scaleY(1); opacity:1; } 50%{ transform: scaleY(.45); opacity:.75; } }

.audio-result-box { display: flex; align-items: center; gap: 1.3rem; margin-top: 1.3rem; background: var(--bg-soft); padding: 1.2rem 1.4rem; border-radius: var(--radius-sm); border: 1px solid var(--border); flex-wrap: wrap; }
.audio-controls { flex-grow: 1; display: flex; align-items: center; gap: .9rem; min-width: 200px; }
.audio-timeline { flex-grow: 1; height: 6px; background: var(--border); border-radius: 3px; position: relative; cursor: pointer; }
.audio-timeline-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: linear-gradient(90deg, var(--indigo), var(--sky)); border-radius: 3px; }
.audio-time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   VOIX — petites cartes (app utilisateur)
   ============================================================ */
.voices-grid-app { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.voice-mini-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem; position: relative; }
.voice-mini-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .6rem; }
.voice-mini-name { font-weight: 700; font-size: .92rem; }
.voice-mini-lang { font-size: .78rem; color: var(--muted); }
.star-btn { background: none; border: 0; cursor: pointer; color: var(--border); font-size: 1.2rem; padding: 0; line-height: 1; }
.star-btn.is-default { color: var(--amber); }
.voice-mini-ref { font-size: .82rem; color: var(--ink-soft); background: var(--bg-soft); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .8rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.voice-mini-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-mini-actions { display: flex; gap: .4rem; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 2rem 1rem; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .15s; }
.upload-zone:hover { border-color: var(--indigo); color: var(--indigo); }
.upload-zone svg { width: 28px; height: 28px; margin: 0 auto .6rem; }

/* ============================================================
   CRÉDITS
   ============================================================ */
.credit-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.credit-big { text-align: center; }
.credit-big .num { font-family: "Sora", sans-serif; font-size: 2.4rem; font-weight: 800; color: var(--indigo); }

/* ============================================================
   MODALS & TOASTS
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,16,30,.55); backdrop-filter: blur(3px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.active { display: flex; }
.modal-card { background: var(--card); border-radius: var(--radius); padding: 1.8rem; max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow); animation: modalIn .25s ease; }
@keyframes modalIn { from { transform: scale(.96) translateY(14px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.modal-card p { font-size: .9rem; margin-bottom: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1rem; }
.modal-card.modal-danger h3 { color: var(--red); }

.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300; display: flex; flex-direction: column; gap: .6rem; }
.toast { background: var(--ink); color: var(--bg); padding: .85rem 1.2rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow); display: flex; align-items: center; gap: .7rem; min-width: 240px; animation: toastIn .25s ease; }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 1.1rem; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout .sidebar { background: var(--ink); border-right: 0; }
.admin-layout .sidebar-logo { color: #fff; }
.admin-layout .sidebar-nav a { color: #b8b9d6; }
.admin-layout .sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-layout .sidebar-nav a.active { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; }
.admin-layout .sidebar-divider { border-top-color: rgba(255,255,255,.1); }

/* ---- charts (CSS pur, pas de librairie) ---- */
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.3rem; margin-bottom: 1.3rem; }
.bar-chart { display: flex; align-items: flex-end; gap: .8rem; height: 160px; padding-top: 1rem; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .4rem; }
.bar-chart .bar { width: 100%; max-width: 32px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--sky), var(--indigo)); transition: height .4s ease; }
.bar-chart .bar-lbl { font-size: .76rem; color: var(--muted); }

.pie-chart-wrap { display: flex; align-items: center; gap: 1.3rem; justify-content: center; padding-top: .5rem; flex-wrap: wrap; }
.pie-chart { width: 130px; height: 130px; border-radius: 50%; flex-shrink: 0; }
.pie-legend { display: flex; flex-direction: column; gap: .5rem; }
.pie-legend-item { display: flex; align-items: center; gap: .5rem; font-size: .84rem; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.earning-card { background: linear-gradient(135deg, var(--indigo-dark), var(--violet)); color: #fff; border-radius: var(--radius); padding: 1.5rem; }
.earning-card .lbl { font-size: .82rem; opacity: .85; }
.earning-card .num { font-family: "Sora", sans-serif; font-size: 2rem; font-weight: 800; margin: .3rem 0 1rem; }
.earning-split { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.earning-split div { font-size: .8rem; opacity: .9; }
.earning-split strong { display: block; font-size: 1rem; opacity: 1; }
.trend-up { color: var(--green, #10b981); }
.trend-down { color: var(--red, #ef4444); }

.top-users-list { display: flex; flex-direction: column; gap: .1rem; }
.top-user-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.top-user-row:first-child { border-top: 0; }
.top-user-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 700; flex-shrink: 0; }
.top-user-rank.top3 { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; }
.top-user-email { flex: 1; font-size: .87rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user-amount { font-size: .87rem; font-weight: 700; color: var(--indigo); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .features-grid, .voice-grid, .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -100%; z-index: 90; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
}
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 640px) {
  .features-grid, .voice-grid, .testimonial-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .app-content { padding: 1.1rem; }
}

/* ============================================================
   VUES SIDEBAR (manquait dans la v42)
   ============================================================ */
.app-content > .uv { display: none; }
.app-content > .uv.active { display: block; }
.app-content > .av { display: none; }
.app-content > .av.active { display: block; }

/* auth-view */
.auth-shell { display: none; }
.auth-shell:not(.hidden) { display: flex; }

/* ============================================================
   CORRECTIFS v42.5 → v42.6
   ============================================================ */

/* Fond "adouci" : ne pas toucher à --ink (texte principal) ni aux couleurs de texte des sidebars */
[data-bg="soft"][data-theme="light"] .sidebar { --card: #ffffff; }
[data-bg="soft"] { --ink: #15172b; }  /* forcer le texte à rester sombre en mode clair */

/* Badges colorés manquants */
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-blocked, .badge-red { background: var(--red-soft); color: var(--red); }
.badge-admin { background: var(--indigo-soft); color: var(--indigo-dark); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-pending { background: var(--amber-soft); color: var(--amber); }
.badge-muted { background: var(--bg-soft); color: var(--muted); }
[data-theme="dark"] .badge-active { color: #4ade80; }
[data-theme="dark"] .badge-admin { color: #cfcdff; }

/* Sidebar admin : même couleur que user (plus de fond sombre forcé) */
.admin-layout .sidebar { background: var(--card); border-right: 1px solid var(--border); }
.admin-layout .sidebar-logo { color: var(--ink); }
.admin-layout .sidebar-nav a { color: var(--ink-soft); }
.admin-layout .sidebar-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.admin-layout .sidebar-nav a.active { background: var(--indigo-soft); color: var(--indigo); font-weight: 700; }
[data-theme="dark"] .admin-layout .sidebar-nav a.active { color: #cfcdff; }
.admin-layout .sidebar-divider { border-top-color: var(--border); }

/* Messages d'erreur/auth bien visibles */
.form-error, .auth-error { color: var(--red); font-weight: 600; font-size: .88rem; margin-top: .5rem; display: block; }

/* Transition page loader */
.page-loader { transition: opacity .3s ease; }
.page-loader.active { pointer-events: all; opacity: 1; }

/* Paramètres : 2 colonnes (Apparence + Synthèse par défaut / Mot de passe + 2FA) */
.settings-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; margin-bottom: 1.3rem; }
@media (max-width: 860px) { .settings-row-2 { grid-template-columns: 1fr; } }

/* Crédits : stat-box centré */
.credit-big { text-align: center; }
.credit-big .num { font-family: "Sora", sans-serif; font-size: 2.4rem; font-weight: 800; color: var(--indigo); }
.credit-big .num.secondary { color: var(--indigo); }

/* Voix mini-cartes (vue Voix utilisateur) */
.voices-grid-app { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.voice-mini-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem; }
.voice-mini-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .6rem; }
.voice-mini-name { font-weight: 700; font-size: .92rem; }
.voice-mini-lang { font-size: .78rem; color: var(--muted); }
.star-btn { background: none; border: 0; cursor: pointer; color: var(--border); font-size: 1.4rem; padding: 0; line-height: 1; }
.star-btn.is-default { color: var(--amber); }
.voice-mini-ref { font-size: .82rem; color: var(--ink-soft); background: var(--bg-soft); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .8rem; }

/* pill email (email personnalisé admin) */
.pill-input-wrap { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .7rem; background: var(--bg); cursor: text; }
.pill-input-wrap input { border: 0; background: transparent; font-size: .88rem; color: var(--ink); flex: 1; min-width: 160px; outline: none; }
.email-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--indigo-soft); color: var(--indigo-dark); font-size: .8rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; }
.email-pill button { background: none; border: 0; cursor: pointer; color: inherit; opacity: .7; font-size: 1rem; padding: 0; line-height: 1; }
[data-theme="dark"] .email-pill { color: #cfcdff; }

/* Barre de progression studio */
.progress-box { margin-top: 1rem; }
.progress-info { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-soft); margin-bottom: .4rem; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--indigo), var(--sky)); border-radius: 999px; transition: width .25s ease; width: 0%; }

/* Alert personnalisé (remplace window.confirm) */
.custom-confirm-overlay { position: fixed; inset: 0; background: rgba(15,16,30,.55); backdrop-filter: blur(3px); z-index: 500; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.custom-confirm-overlay.active { display: flex; }
.custom-confirm-card { background: var(--card); border-radius: var(--radius); padding: 1.8rem; max-width: 400px; width: 100%; box-shadow: var(--shadow); animation: modalIn .22s ease; }
.custom-confirm-card h4 { margin: 0 0 .7rem; font-size: 1.1rem; }
.custom-confirm-card p { font-size: .9rem; color: var(--ink-soft); margin-bottom: 1.3rem; }
@keyframes modalIn { from { transform: scale(.96) translateY(12px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* Filtre date historique */
input[type="date"].input { padding: .6rem .8rem; }

/* Landing : texte des cartes héro toujours lisible (retour à la ligne) */
.hero-card-text { word-break: break-word; overflow-wrap: break-word; white-space: normal; }

/* idle-notice (correction : plus de display:flex inline) */
.idle-notice-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--amber-soft); color: var(--ink);
  text-align: center; padding: .55rem 2.5rem .55rem 1rem;
  font-size: .88rem; display: flex; align-items: center;
  justify-content: center; gap: .8rem;
}
.idle-notice-bar[hidden] { display: none !important; }
.idle-notice-close {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font-size: 1.3rem; cursor: pointer;
  color: inherit; opacity: .7; line-height: 1;
}
.idle-notice-close:hover { opacity: 1; }

/* ============================================================
   SIDEBAR MOBILE — hamburger + overlay
   ============================================================ */
.hamburger-btn {
  display: none; background: none; border: 0; cursor: pointer;
  color: var(--ink); padding: .3rem; border-radius: 8px;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,16,30,.45);
  backdrop-filter: blur(2px); z-index: 90;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 780px) {
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }

  /* Sidebar cachée hors écran par défaut sur mobile */
  .app-layout .sidebar,
  .admin-layout .sidebar {
    position: fixed; left: -280px; top: 0; height: 100%; z-index: 100;
    transition: left .25s ease; box-shadow: none;
    overflow-y: auto;
  }

  /* Ouverte */
  .app-layout .sidebar.sidebar-open,
  .admin-layout .sidebar.sidebar-open {
    left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }

  /* Le contenu principal prend toute la largeur */
  .app-layout,
  .admin-layout {
    flex-direction: column;
  }
  .app-main { width: 100%; min-width: 0; }
  .app-topbar { padding: .7rem 1rem; }
  .chart-grid,
  .settings-row-2 { grid-template-columns: 1fr !important; }
  .stat-row { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr 1fr !important; }
  .table-toolbar { flex-wrap: wrap; gap: .4rem; }
  .table-toolbar .input { font-size: .82rem; }
  .data-table th, .data-table td { padding: .45rem .5rem; font-size: .82rem; }
}
#toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 99999;
  background: var(--card);
  color: var(--ink);
  padding: .85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-width: 360px;
  pointer-events: auto;
  display: block;
  transition: opacity .18s ease, transform .18s ease;
}
#toast[hidden] { display: none; opacity: 0; transform: translateY(6px); }
#toast:not([hidden]) { opacity: 1; transform: translateY(0); }

/* masquer le bouton pour ceux qui ne sont pas admin */
.admin-back-btn {
  display: none !important;
}
.admin-back-btn.visible {
  display: inline-flex !important;
}

/* ---- Workflow isométrique ---- */
.workflow-iso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.workflow-step {
  text-align: center;
  max-width: 220px;
  flex: 1 1 180px;
  opacity: 0;
  transform: translateY(20px);
  animation: wf-in .6s ease forwards;
}

.workflow-step:nth-child(1) { animation-delay: .1s; }
.workflow-step:nth-child(3) { animation-delay: .3s; }
.workflow-step:nth-child(5) { animation-delay: .5s; }

@keyframes wf-in {
  to { opacity: 1; transform: translateY(0); }
}

.workflow-step h3 {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.workflow-step p {
  font-size: .88rem;
  color: var(--muted);
  margin-top: .4rem;
  line-height: 1.5;
}

.workflow-arrow {
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .6;
}

.workflow-arrow svg {
  width: 60px;
  height: 24px;
}

/* Isometric cubes */
.iso-scene {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  perspective: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iso-scene::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.10) 0%, transparent 70%);
  pointer-events: none;
}

.iso-cube {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-30deg) rotateY(-45deg);
  animation: iso-float 5s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(79, 70, 229, 0.25));
}

@keyframes iso-float {
  0%, 100% { transform: rotateX(-30deg) rotateY(-45deg) translateY(0); }
  50% { transform: rotateX(-30deg) rotateY(-45deg) translateY(-10px); }
}

.face {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(255,255,255,0.08);
}

.face-top {
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  transform: rotateX(90deg) translateZ(50px);
}

.face-left {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  transform: rotateY(-90deg) translateZ(50px);
}

.face-right {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  transform: rotateY(0deg) translateZ(50px);
}

.iso-cube.accent .face-top {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.iso-cube.accent .face-left {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.iso-cube.accent .face-right {
  background: linear-gradient(135deg, #d946ef, #a855f7);
}

.cube-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
}

/* Animated dot on arrow */
.wf-dot {
  fill: var(--sky);
  animation: wf-dot-move 2s linear infinite;
}

@keyframes wf-dot-move {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

@media (max-width: 768px) {
  .workflow-iso { flex-direction: column; gap: 2.5rem; }
  .workflow-arrow { transform: rotate(90deg); flex: 0 0 40px; }
}