/* Fallah — « Mon espace ». Couleur : bleu-violet. Animations douces, coupées si le téléphone le demande. */
#espace { --tint: #e3e8ff; --edge: #a9b8f5; --glow: rgba(70, 90, 210, .18);
  background: linear-gradient(180deg, color-mix(in srgb, #e3e8ff 55%, var(--paper) 45%) 0, var(--paper) 360px); }
#espace .catalogue-header { background: linear-gradient(180deg, rgba(255, 252, 246, .97), color-mix(in srgb, #e3e8ff 55%, #fffaf2 45%)); border-bottom: 2px solid var(--edge); }
#espace .catalogue-header > div { display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; align-items: center; }
#espace .catalogue-header > div::before { content: ""; grid-row: 1 / span 2; width: 2.7rem; height: 2.7rem; border-radius: 12px; background: url(/assets/ui/espace.svg) center / cover no-repeat; box-shadow: 0 5px 12px var(--glow); }
#espace .catalogue-header h2 { font-weight: 900; }
#espace-root { padding-bottom: 120px; }

@keyframes es-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes es-spin { to { transform: rotate(360deg); } }
@keyframes es-glow { 0%, 100% { box-shadow: 0 10px 24px rgba(229, 140, 20, .18); } 50% { box-shadow: 0 10px 30px rgba(229, 140, 20, .38); } }
.es-in { animation: es-up .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@media (prefers-reduced-motion: reduce) { .es-in, .es-spinner, .es-bad { animation: none !important; } }

.es-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 18px; border-radius: 24px; color: #fff;
  background: linear-gradient(140deg, #7d8cff, #4a55d6); box-shadow: 0 14px 28px rgba(74, 85, 214, .3); position: relative; overflow: hidden; }
.es-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: #fff; opacity: .12; }
.es-avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(255, 255, 255, .22); font-size: 2.2rem; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.es-hero h3 { margin: 0 0 4px; font-size: 1.35rem; }
.es-hero p { margin: 0; font-size: .88rem; line-height: 1.45; color: #eef0ff; }
.es-reminder { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff3dc; color: #9a5b00; font-weight: 900; }

.es-card { margin-top: 14px; padding: 16px; border-radius: 22px; background: #fffdf8; border: 2px solid #eadcc4; box-shadow: 0 10px 22px rgba(70, 48, 15, .06); }
.es-shield header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.es-shield-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; font-size: 1.6rem; background: #eef1ff; }
.es-shield small { display: block; color: #7a6e5e; font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.es-shield strong { font-size: 1.08rem; }
.es-good { border-color: #9fdcb4; background: linear-gradient(160deg, #fff, #ecfaf1); }
.es-good .es-shield-ico { background: #d9f5e3; }
.es-mid { border-color: #f3d27a; background: linear-gradient(160deg, #fff, #fff8e6); }
.es-mid .es-shield-ico { background: #ffefc4; }
.es-bad { border-color: #f6b88a; background: linear-gradient(160deg, #fff, #fff1e6); animation: es-glow 2.6s ease-in-out infinite; }
.es-bad .es-shield-ico { background: #ffe0c8; }
.es-shield ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.es-shield li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .88rem; font-weight: 700; }
.es-shield li i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-weight: 900; font-size: .8rem; color: #fff; }
.es-shield li.ok i { background: #22a35a; }
.es-shield li.warn i, .es-shield li.ko i { background: #f08c00; }
.es-shield li.unknown i { background: #b8ab97; }
.es-shield li button { padding: 6px 12px; border: 0; border-radius: 99px; background: linear-gradient(135deg, #7d8cff, #4a55d6); color: #fff; font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }

.es-actions { margin-top: 16px; display: grid; }
.es-primary, .es-secondary, .es-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 16px; font: inherit; font-size: 1.05rem; font-weight: 900; cursor: pointer; text-align: center; }
.es-primary { border: 0; color: #fff; background: linear-gradient(135deg, #3ccf6e, #138a46); box-shadow: 0 10px 22px rgba(19, 138, 70, .28), inset 0 1px 0 rgba(255, 255, 255, .35); }
.es-secondary { margin-top: 12px; border: 2px solid #b9c3f5; color: #3a43b5; background: #f3f5ff; }
.es-ghost { margin-top: 8px; min-height: 46px; border: 0; background: transparent; color: #7a6e5e; font-size: .95rem; }
.es-primary:disabled, .es-secondary.disabled { opacity: .55; pointer-events: none; }
.es-help { margin: 6px 4px 0; color: #7a6e5e; font-size: .8rem; line-height: 1.4; }
.es-busy { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #eef1ff; color: #3a43b5; font-weight: 900; }
.es-spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #b9c3f5; border-top-color: #4a55d6; animation: es-spin .8s linear infinite; }
.es-restore h4 { margin: 0 0 8px; font-size: 1.02rem; }
.es-restore p { margin: 6px 0; }
.es-counts { font-weight: 900; color: #3b3027; }
.es-safe { padding: 10px 12px; border-radius: 12px; background: #ecfaf1; color: #1f7a43; font-size: .85rem; font-weight: 700; line-height: 1.4; }

.es-h { margin: 22px 0 10px; font-size: 1.05rem; font-weight: 900; }
.es-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.es-tile { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: #fffdf8; border: 1px solid #eadcc4; text-align: center; }
.es-tile span { font-size: 1.3rem; }
.es-tile b { font-size: 1.2rem; font-weight: 900; }
.es-tile small { font-size: .7rem; font-weight: 800; color: #7a6e5e; }
.es-meta { margin: 12px 0 0; text-align: center; color: #8a7b66; font-size: .78rem; font-weight: 700; }
.es-soon { margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; background: #f3f0ff; color: #5b3fb5; font-size: .84rem; font-weight: 700; line-height: 1.45; }

/* Rappel de sauvegarde : petit point sur « Mon espace » dans la barre du bas */
.bottom-nav button.nav-due { position: relative; }
.bottom-nav button.nav-due::after { content: ""; position: absolute; top: 8px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: #f08c00; border: 2px solid #fff; }
