/* ============================================================
   Cadetel — Design system "Aurora" 2026
   Canvas clair aurora · sidebar flottante en verre · cartes bento
   · typo display Space Grotesk · accents dégradés violet→cyan.
   ============================================================ */
:root {
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;

    --v1: #7c5cff;   /* violet */
    --v2: #5b8def;   /* bleu   */
    --v3: #22d3ee;   /* cyan   */
    --pop: #b8f24a;  /* lime accent */
    --grad: linear-gradient(135deg, #7c5cff 0%, #5b8def 52%, #22d3ee 100%);
    --grad-soft: linear-gradient(135deg, rgba(124,92,255,.14), rgba(34,211,238,.12));

    --ink: #14151f;
    --ink-soft: #4c4f63;
    --ink-faint: #8b8fa6;

    --canvas: #f3f3fb;
    --surface: #ffffff;
    --line: #ecebf5;

    --sidebar-1: #1b1c31;
    --sidebar-2: #131322;
    --sidebar-fg: #b6b9d6;

    --r-xl: 26px; --r-lg: 20px; --r-md: 14px; --r-sm: 11px;
    --sh-sm: 0 2px 6px rgba(23,20,54,.05);
    --sh-md: 0 10px 30px rgba(23,20,54,.08), 0 2px 8px rgba(23,20,54,.05);
    --sh-lg: 0 30px 70px rgba(23,20,54,.20);
    --sh-glow: 0 12px 30px rgba(124,92,255,.35);
    --ring: 0 0 0 4px rgba(124,92,255,.16);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink-soft);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
    position: relative;
}

/* ---------- Fond aurora décoratif ---------- */
.aurora-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
    radial-gradient(1100px 700px at 8% -5%, #ede9ff 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #e0f5fb 0%, transparent 50%),
    linear-gradient(180deg, #f6f5fe 0%, #f1f2fb 100%); }
.aurora-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.aurora-bg span:nth-child(1) { width: 480px; height: 480px; left: -80px; top: 10%; background: #c7b8ff; }
.aurora-bg span:nth-child(2) { width: 420px; height: 420px; right: -60px; top: 40%; background: #a9e7f5; opacity: .4; }
.aurora-bg span:nth-child(3) { width: 360px; height: 360px; left: 40%; bottom: -120px; background: #d9f7a6; opacity: .28; }

h1, h2, h3, h4, .fw-bold, .topbar-title, .page-head h1, .brand-name, .sc-value, .modal-title, .ci-title, .stat-card .sc-value {
    font-family: var(--font-display); letter-spacing: -.02em;
}
a { color: var(--v2); text-decoration: none; }
a:hover { color: var(--v1); }
.text-primary { color: var(--v1) !important; }

/* ---------- Boutons ---------- */
.btn { border-radius: 999px; font-weight: 600; padding: .52rem 1.05rem; font-family: var(--font-body); transition: transform .12s, box-shadow .2s, background .2s, filter .2s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .34rem .8rem; font-size: .82rem; }
.btn-primary, .bg-primary { background: var(--grad) !important; border: none !important; box-shadow: var(--sh-glow); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 16px 36px rgba(124,92,255,.45); }
.btn-outline-primary { color: var(--v1); border: 1.5px solid #ded8ff; background: #fff; }
.btn-outline-primary:hover { background: var(--grad-soft); border-color: #cfc4ff; color: var(--v1); }
.btn-outline-secondary { border: 1.5px solid var(--line); color: var(--ink-soft); background: rgba(255,255,255,.7); }
.btn-outline-secondary:hover { background: #fff; color: var(--ink); border-color: #dcdbea; }
.btn-outline-danger { border-width: 1.5px; }
.btn-outline-danger:hover { background: #fff1f2; }
.btn-light { background: rgba(255,255,255,.85); border: 1px solid var(--line); }
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-md); padding: .4rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; font-weight: 500; }
.dropdown-item:hover { background: var(--grad-soft); color: var(--v1); }

/* ---------- Champs ---------- */
.form-control, .form-select { border-radius: 12px; border: 1.5px solid #e6e5f2; padding: .58rem .85rem; background: #fbfbff; transition: border-color .15s, box-shadow .15s, background .15s; }
.form-control:focus, .form-select:focus { border-color: var(--v1); box-shadow: var(--ring); background: #fff; }
.form-control::placeholder { color: #adb0c6; }
.form-label { font-weight: 600; font-size: .8rem; color: var(--ink-soft); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--v1); border-color: var(--v1); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--v1); }

/* ============================================================
   Coquille : sidebar flottante en verre
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 254px; flex: 0 0 254px;
    margin: 16px 0 16px 16px; height: calc(100vh - 32px); position: sticky; top: 16px;
    background: linear-gradient(165deg, var(--sidebar-1), var(--sidebar-2));
    color: var(--sidebar-fg);
    border-radius: var(--r-xl); border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 24px 50px rgba(20,18,50,.28);
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 200px at 20% 0%, rgba(124,92,255,.30), transparent 60%); pointer-events: none; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.35rem 1.4rem 1rem; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.25rem; position: relative; }
.brand-logo { width: 40px; height: 40px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 8px 20px rgba(124,92,255,.5); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .4rem .8rem 1rem; position: relative; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 5px; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .8rem; position: relative; color: var(--sidebar-fg); border-radius: 13px; padding: .62rem .85rem; margin-bottom: 3px; font-size: .91rem; font-weight: 500; transition: background .16s, color .16s, transform .12s; }
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: .75; transition: opacity .16s, transform .16s; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.sidebar-nav .nav-link:hover i { opacity: 1; }
.sidebar-nav .nav-link.active { background: linear-gradient(120deg, rgba(124,92,255,.9), rgba(91,141,239,.85)); color: #fff; box-shadow: 0 8px 20px rgba(124,92,255,.4); }
.sidebar-nav .nav-link.active i { opacity: 1; color: #fff; transform: scale(1.05); }
.nav-section { text-transform: uppercase; font-size: .66rem; letter-spacing: .14em; color: #6a6e94; padding: 1.1rem .9rem .45rem; font-weight: 700; }
.sidebar-footer { padding: .9rem 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.07); position: relative; }
.user-chip { display: flex; align-items: center; gap: .65rem; }
.user-avatar { width: 40px; height: 40px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { color: #fff; font-size: .92rem; font-family: var(--font-display); }
.user-meta small { color: #7f83a6; font-size: .74rem; }
.sidebar-footer .btn-outline-light { border: 1px solid rgba(255,255,255,.16); color: #d3d6ee; border-radius: 12px; }
.sidebar-footer .btn-outline-light:hover { background: rgba(255,255,255,.09); color: #fff; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { background: rgba(247,246,254,.75); backdrop-filter: saturate(1.8) blur(14px); border-bottom: 1px solid rgba(236,235,245,.9); padding: 1rem 2rem; position: sticky; top: 0; z-index: 20; }
.topbar-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.app-content { padding: 1.9rem 2rem 3rem; max-width: 1340px; width: 100%; animation: rise .4s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.85rem; font-weight: 700; margin: 0; color: var(--ink); }

/* ---------- Dashboard hero ---------- */
.dash-hero { position: relative; border-radius: var(--r-xl); padding: 2rem 2.2rem; margin-bottom: 1.8rem; color: #fff; overflow: hidden; background: linear-gradient(120deg, #6d4bff 0%, #5b8def 55%, #22d3ee 120%); box-shadow: 0 24px 50px rgba(90,70,220,.32); }
.dash-hero::before { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); }
.dash-hero::after { content: ""; position: absolute; right: 8%; bottom: -140px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(184,242,74,.35), transparent 60%); }
.dash-hero-content { position: relative; }

/* ============================================================
   Listes (rows distinctives, pas des lignes plates Glide)
   ============================================================ */
.collection-list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; border: 1px solid var(--line); }
.collection-item { display: flex; align-items: center; gap: .95rem; position: relative; padding: .8rem 1.15rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .16s; cursor: pointer; }
.collection-item::before { content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 3px; border-radius: 3px; background: var(--grad); opacity: 0; transition: opacity .16s; }
.collection-item:last-child { border-bottom: 0; }
.collection-item:hover { background: linear-gradient(90deg, rgba(124,92,255,.05), transparent 55%); }
.collection-item:hover::before { opacity: 1; }
.collection-item:hover .ci-title { color: var(--v1); }

.ci-chip { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--v1); background: var(--grad-soft); border: 1px solid rgba(124,92,255,.14); }
.ci-body { flex: 1 1 auto; min-width: 0; }
.ci-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink); transition: color .16s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-sub { color: var(--ink-faint); font-size: .86rem; margin-top: .05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-side { display: flex; flex-direction: column; align-items: flex-end; gap: .28rem; flex: 0 0 auto; text-align: right; }
.ci-eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--v1); background: var(--grad-soft); padding: .16rem .55rem; border-radius: 999px; white-space: nowrap; }
.ci-right { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: .95rem; white-space: nowrap; }
.ci-arrow { color: #c3c6da; font-size: .8rem; flex: 0 0 auto; transition: transform .16s, color .16s; }
.collection-item:hover .ci-arrow { color: var(--v1); transform: translateX(3px); }

/* ---------- Cartes bento & stat ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px,1fr)); gap: 1.15rem; margin-bottom: 1.8rem; }
.stat-card { position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 1.3rem 1.4rem; box-shadow: var(--sh-sm); border: 1px solid var(--line); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--grad-soft); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.stat-card .sc-label { color: var(--ink-faint); font-size: .82rem; font-weight: 600; position: relative; }
.stat-card .sc-value { font-size: 2.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; position: relative; }
.stat-card .sc-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; color: #fff; background: var(--grad); box-shadow: var(--sh-glow); position: relative; }

/* ---------- Page Administration ---------- */
.admin-section-title { font-family: var(--font-display); font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .09em; font-size: .76rem; margin: .4rem 0 .85rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.admin-tile { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.25rem; box-shadow: var(--sh-sm); text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.admin-tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--grad-soft); opacity: .7; transition: opacity .18s; }
.admin-tile:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: #dcd7fb; }
.admin-tile:hover::after { opacity: 1; }
.admin-chip { width: 48px; height: 48px; border-radius: 14px; background: var(--grad-soft); color: var(--v1); display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 auto; border: 1px solid rgba(124,92,255,.14); position: relative; z-index: 1; transition: background .18s, color .18s, box-shadow .18s; }
.admin-tile:hover .admin-chip { background: var(--grad); color: #fff; box-shadow: var(--sh-glow); border-color: transparent; }
.admin-tile-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.admin-tile-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.admin-tile-sub { color: var(--ink-faint); font-size: .83rem; }
.admin-arrow { color: #c3c6da; flex: 0 0 auto; position: relative; z-index: 1; transition: transform .18s, color .18s; }
.admin-tile:hover .admin-arrow { color: var(--v1); transform: translateX(4px); }

.card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; color: var(--ink); padding: 1rem 1.25rem; border-radius: var(--r-lg) var(--r-lg) 0 0 !important; }
.card-body { padding: 1.25rem; }
.list-group-item { border-color: var(--line); padding: .85rem 1.25rem; background: transparent; }
.list-group-item-action:hover { background: rgba(124,92,255,.05); }

/* ---------- En-tête profil (fiche utilisateur…) ---------- */
.profile-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .5rem; }
.profile-avatar { width: 66px; height: 66px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; box-shadow: var(--sh-glow); flex: 0 0 auto; }
.profile-meta h2 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .1rem; font-size: 1.4rem; color: var(--ink); }
.profile-meta code, .detail-grid code { background: #f1f0fb; color: var(--v1); padding: .12rem .45rem; border-radius: 7px; font-size: .85rem; }

.detail-grid { display: grid; grid-template-columns: 185px 1fr; gap: .6rem 1rem; }
.detail-grid dt { color: var(--ink-faint); font-weight: 600; font-size: .84rem; }
.detail-grid dd { margin: 0; font-weight: 500; color: var(--ink); }

.table { --bs-table-border-color: var(--line); }
.table > thead th { color: var(--ink-faint); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.table > :not(caption) > * > * { padding: .8rem .85rem; }
.table-light { --bs-table-bg: #f7f7fd; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; padding: .42em .75em; border-radius: 999px; font-size: .73rem; letter-spacing: .01em; }
.badge.bg-success { background: #dcfce7 !important; color: #15803d !important; }
.badge.bg-danger { background: #ffe4e6 !important; color: #be123c !important; }
.badge.bg-warning { background: #fef3c7 !important; color: #b45309 !important; }
.badge.bg-secondary { background: #eeedf7 !important; color: #55586b !important; }
.badge.bg-info { background: #dbeafe !important; color: #1d4ed8 !important; }
.badge.bg-primary { background: var(--grad-soft) !important; color: var(--v1) !important; }

/* ---------- Filtres pills ---------- */
.btn.btn-outline-secondary.btn-sm, .btn.btn-primary.btn-sm { border-radius: 999px; }

/* ============================================================
   Modales
   ============================================================ */
.modal-content { border: none; border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 1.1rem 1.5rem; background: var(--grad-soft); }
.modal-header .modal-actions { flex: 0 0 auto; }
.modal-header .btn-close { margin: 0; flex: 0 0 auto; }
.modal-title { font-weight: 700; font-family: var(--font-display); flex: 1 1 auto; min-width: 0; }
.modal-body { padding: 1.5rem 1.6rem; }
.modal .card { box-shadow: none; }
.modal .page-head { display: none; }
.modal-backdrop.show { opacity: .4; background: #1a1830; }
.modal.fade .modal-dialog { transition: transform .25s cubic-bezier(.34,1.3,.4,1), opacity .25s; transform: translateY(18px) scale(.97); }
.modal.show .modal-dialog { transform: none; }
.collection-entry, .ligne-row { background: #fafaff; border-color: var(--line) !important; border-radius: var(--r-md) !important; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; }
.app-toast { display: flex; align-items: start; gap: .7rem; min-width: 310px; max-width: 410px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-radius: 16px; padding: .9rem 1.05rem; box-shadow: var(--sh-lg); border: 1px solid var(--line); border-left: 4px solid var(--v1); animation: toastIn .35s cubic-bezier(.34,1.3,.5,1) both; }
.app-toast.ok { border-left-color: #16a34a; }
.app-toast.error { border-left-color: #e11d48; }
.app-toast .ti-icon { font-size: 1.2rem; color: var(--v1); }
.app-toast.ok .ti-icon { color: #16a34a; }
.app-toast.error .ti-icon { color: #e11d48; }
.app-toast .ti-body { flex: 1; font-size: .9rem; font-weight: 500; color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: none; } }
.app-toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(50px); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; position: relative; z-index: 1; }
.login-card { background: rgba(255,255,255,.82); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.6); border-radius: 30px; padding: 2.7rem; width: 100%; max-width: 420px; box-shadow: 0 40px 90px rgba(30,25,70,.28); animation: rise .5s ease both; }
.login-logo { width: 66px; height: 66px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: 1.8rem; margin: 0 auto 1.2rem; box-shadow: 0 14px 30px rgba(124,92,255,.55); }

.modal-loading { padding: 3.5rem; text-align: center; }
.spinner-border { color: var(--v1); }

/* ---------- Configurateur baby-foot ---------- */
.conf-total { position: sticky; top: 1rem; }
.conf-amount { font-family: var(--font-display); font-weight: 700; font-size: 1.85rem; color: var(--ink); line-height: 1.1; }
.conf-block { opacity: .45; transition: opacity .2s; }
[data-controller="configurateur"]:not(.tarif-public) .conf-ht,
[data-controller="configurateur"].tarif-public .conf-ttc { opacity: 1; }
[data-controller="configurateur"]:not(.tarif-public) .conf-ht .conf-amount,
[data-controller="configurateur"].tarif-public .conf-ttc .conf-amount { color: var(--v1); }

/* ---------- Dictée vocale ---------- */
.dictation-hint { color: #e11d48; font-weight: 500; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e11d48; margin-right: .35rem; vertical-align: middle; animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.65); } }
.dictating textarea { border-color: #f43f5e !important; box-shadow: 0 0 0 4px rgba(244, 63, 94, .12) !important; }
.dictating [data-dictation-target="button"] i { animation: recPulse 1s infinite; }

.sidebar-backdrop { display: none; }

@media (max-width: 992px) {
    .sidebar { position: fixed; z-index: 1050; margin: 0; height: 100vh; top: 0; left: 0; border-radius: 0 var(--r-xl) var(--r-xl) 0; transform: translateX(-105%); transition: transform .25s ease; }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 0 0 60px rgba(20,18,50,.5); }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(20,18,50,.45); backdrop-filter: blur(2px); z-index: 1049; opacity: 0; transition: opacity .25s; pointer-events: none; }
    .app-shell.sidebar-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
    .app-content { padding: 1.1rem; }
    .app-topbar { padding: .8rem 1.1rem; }
    .page-head h1 { font-size: 1.5rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .dash-hero { padding: 1.5rem 1.4rem; }
}
