/* ============================================================
   Rewingo — Espace client (maquette)
   DA : clair, frais, inspiré Google / Arturin. Bleu royal + navy,
   accents vert & or. Aucun dégradé violet.
   ============================================================ */

:root {
    /* Surfaces */
    --bg: #f5f7fb;
    --bg-soft: #eef2fa;
    --surface: #ffffff;

    /* Encre */
    --ink: #0f1b33;
    --ink-2: #3a4a63;
    --muted: #7a8aa3;

    /* Traits */
    --line: #e7ecf4;
    --line-strong: #dbe2ee;

    /* Marque */
    --primary: #2563eb;
    --primary-strong: #1b4fd1;
    --primary-050: #eaf1ff;
    --primary-100: #d7e5ff;

    /* Accents */
    --success: #16a34a;
    --success-bg: #e4f7ec;
    --gold: #f5a524;
    --gold-bg: #fef3dd;
    --danger: #dc2626;

    /* Ombres */
    --shadow-xs: 0 1px 2px rgba(16, 30, 54, .06);
    --shadow-sm: 0 2px 8px rgba(16, 30, 54, .06);
    --shadow-md: 0 8px 24px rgba(16, 30, 54, .08);
    --shadow-lg: 0 16px 40px rgba(16, 30, 54, .12);

    /* Rayons */
    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-full: 999px;

    --sidebar-w: 280px;
    --topbar-h: 68px;

    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    margin: 0;
    letter-spacing: -.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

svg {
    display: block;
}

/* ---- La roue de marque (signature) ---------------------------------- */
.wheel-mark {
    position: relative;
    border-radius: 50%;
    background: conic-gradient(from -90deg,
            var(--primary) 0 12.5%,
            #4f86ff 12.5% 25%,
            var(--primary) 25% 37.5%,
            var(--success) 37.5% 50%,
            var(--primary) 50% 62.5%,
            #4f86ff 62.5% 75%,
            var(--primary) 75% 87.5%,
            var(--gold) 87.5% 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), var(--shadow-xs);
    flex: none;
}

.wheel-mark::after {
    content: "";
    position: absolute;
    inset: 30%;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(16, 30, 54, .2);
}

/* ============================================================
   Ossature
   ============================================================ */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---- Sidebar -------------------------------------------------------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    gap: 16px;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
}

.brand .wheel-mark {
    width: 30px;
    height: 30px;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -.02em;
}

.brand-name b {
    color: var(--primary);
    font-weight: 800;
}

/* ---- Sélecteur de workspace ---------------------------------------- */
.ws {
    position: relative;
}

.ws-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: border-color .15s, background .15s, box-shadow .15s;
    text-align: left;
}

.ws-trigger:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}

.ws-trigger[aria-expanded="true"] {
    border-color: var(--primary-100);
    box-shadow: 0 0 0 3px var(--primary-050);
    background: #fff;
}

.ws-photo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    object-fit: cover;
    flex: none;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    box-shadow: var(--shadow-xs);
}

.ws-meta {
    min-width: 0;
    flex: 1;
}

.ws-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-sub {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-caret {
    color: var(--muted);
    flex: none;
    transition: transform .18s;
}

.ws-trigger[aria-expanded="true"] .ws-caret {
    transform: rotate(180deg);
}

/* Menu déroulant */
.ws-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
    z-index: 60;
}

.ws.open .ws-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ws-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-soft);
    border-radius: var(--r-sm);
    margin-bottom: 8px;
}

.ws-search svg {
    color: var(--muted);
    flex: none;
}

.ws-search input {
    border: 0;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    width: 100%;
}

.ws-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 244px;
    overflow: auto;
}

.ws-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 6px 10px 4px;
}

.ws-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background .12s;
}

.ws-item:hover {
    background: var(--bg-soft);
}

.ws-item .ws-photo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 13px;
}

.ws-item-meta {
    min-width: 0;
    flex: 1;
}

.ws-item-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-item-loc {
    font-size: 12px;
    color: var(--muted);
}

.ws-item.active {
    background: var(--primary-050);
}

.ws-check {
    color: var(--primary);
    flex: none;
}

.ws-item:not(.active) .ws-check {
    display: none;
}

.ws-add {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    border-radius: var(--r-sm);
    border: 1px dashed var(--line-strong);
    background: #fff;
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    transition: background .12s, border-color .12s;
}

.ws-add:hover {
    background: var(--primary-050);
    border-color: var(--primary-100);
}

.ws-add .plus {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-050);
    display: grid;
    place-items: center;
    flex: none;
}

/* ---- Navigation ----------------------------------------------------- */
.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    margin: 0 -4px;
    padding: 0 4px;
}

.nav-group {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    transition: background .12s, color .12s;
}

.nav-item svg {
    color: var(--muted);
    flex: none;
    transition: color .12s;
}

.nav-item:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.nav-item:hover svg {
    color: var(--ink-2);
}

.nav-item.active {
    background: var(--primary-050);
    color: var(--primary-strong);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-full);
    font-family: var(--font-body);
}

.nav-item.active .nav-badge {
    background: var(--primary);
}

/* Entrée désactivée (fonctionnalité à venir) */
.nav-item.disabled {
    color: var(--muted);
    cursor: default;
    opacity: .6;
}

.nav-item.disabled:hover {
    background: transparent;
    color: var(--muted);
}

.nav-item.disabled:hover svg {
    color: var(--muted);
}

.nav-badge.soon {
    background: var(--bg-soft);
    color: var(--ink-2);
    border: 1px solid var(--line);
    font-weight: 700;
}

/* ---- Carte compte --------------------------------------------------- */
.account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
}

.account:hover {
    background: var(--bg-soft);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    flex: none;
}

.account-meta {
    min-width: 0;
    flex: 1;
}

.account-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-mail {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    flex: none;
    transition: background .12s, color .12s, border-color .12s;
}

.icon-btn:hover {
    background: var(--bg-soft);
    color: var(--ink);
    border-color: var(--line-strong);
}

/* ============================================================
   Zone principale
   ============================================================ */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Topbar --------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: rgba(245, 247, 251, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    z-index: 30;
}

.hamburger {
    display: none;
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Menus de la topbar (compte + notifications) -------------------- */
.menu-wrap {
    position: relative;
}

.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
}

/* ouverture au clic (notifications) */
.menu-wrap.open > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ouverture au survol / focus (compte) */
.menu-hover:hover > .dropdown,
.menu-hover:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* pont invisible pour ne pas perdre le survol dans l'espace */
.menu-hover > .dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

/* Bouton compte */
.acct-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--r-full);
    border: 1px solid var(--line);
    background: #fff;
    transition: background .12s, border-color .12s, box-shadow .12s;
}

.acct-btn:hover {
    background: var(--bg-soft);
    border-color: var(--line-strong);
}

.menu-hover:focus-within .acct-btn {
    border-color: var(--primary-100);
    box-shadow: 0 0 0 3px var(--primary-050);
}

.acct-caret {
    color: var(--muted);
    transition: transform .18s;
}

.menu-hover:hover .acct-caret {
    transform: rotate(180deg);
}

/* En-tête de menu */
.menu-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.menu-head.between {
    justify-content: space-between;
}

.menu-id {
    min-width: 0;
}

.menu-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ink);
}

.menu-mail {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.menu-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-title .count {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-full);
    font-family: var(--font-body);
}

.menu-link {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
}

.menu-link:hover {
    text-decoration: underline;
}

/* Liste compte */
.menu-list {
    padding: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .12s, color .12s;
}

.menu-item svg {
    color: var(--muted);
    flex: none;
    transition: color .12s;
}

.menu-item:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.menu-item:hover svg {
    color: var(--ink-2);
}

.menu-badge {
    margin-left: auto;
    background: var(--primary-050);
    color: var(--primary-strong);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--r-full);
}

.menu-item.danger {
    color: var(--danger);
}

.menu-item.danger svg {
    color: var(--danger);
}

.menu-item.danger:hover {
    background: #fdeaea;
    color: var(--danger);
}

.menu-sep {
    height: 1px;
    background: var(--line);
    margin: 6px 4px;
}

/* Menu notifications */
.notif-menu {
    width: 360px;
    max-width: calc(100vw - 32px);
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 10px;
    border-radius: var(--r-sm);
    position: relative;
    transition: background .12s;
}

.notif-item:hover {
    background: var(--bg-soft);
}

.notif-item.unread {
    background: var(--primary-050);
}

.notif-item.unread:hover {
    background: var(--primary-100);
}

.notif-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
}

.notif-ico.blue { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }
.notif-ico.green { background: #fff; color: var(--success); box-shadow: var(--shadow-xs); }
.notif-ico.gold { background: #fff; color: var(--gold); box-shadow: var(--shadow-xs); }
.notif-ico.ink { background: #fff; color: var(--ink-2); box-shadow: var(--shadow-xs); }

.notif-body {
    min-width: 0;
    flex: 1;
}

.notif-text {
    display: block;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.45;
}

.notif-text strong {
    color: var(--ink);
    font-weight: 600;
}

.notif-time {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex: none;
    margin-top: 6px;
}

/* État vide (aucune notification) */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 34px 26px 30px;
}

.notif-empty-ico {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg-soft);
    color: var(--muted);
    margin-bottom: 4px;
}

.notif-empty-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}

.notif-empty-sub {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
    max-width: 260px;
}

.menu-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.dot {
    position: relative;
}

.dot::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    border: 1px solid transparent;
    transition: background .15s, box-shadow .15s, transform .05s;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.btn-primary:hover {
    background: var(--primary-strong);
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--bg-soft);
    border-color: var(--line-strong);
}

/* ---- Contenu -------------------------------------------------------- */
.content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hello {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.hello-sub {
    color: var(--muted);
    margin-top: 3px;
}

.head-actions {
    display: flex;
    gap: 10px;
}

/* ---- Tuiles de stats ------------------------------------------------ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .18s, transform .18s;
}

.stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: none;
}

.stat-ico.blue { background: var(--primary-050); color: var(--primary); }
.stat-ico.green { background: var(--success-bg); color: var(--success); }
.stat-ico.gold { background: var(--gold-bg); color: #b9791a; }
.stat-ico.ink { background: #eef1f7; color: var(--ink-2); }

.delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 3px 8px;
    border-radius: var(--r-full);
}

.delta.up { color: var(--success); background: var(--success-bg); }
.delta.down { color: var(--danger); background: #fdeaea; }
.delta.flat { color: var(--muted); background: var(--bg-soft); }

.stat-val {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 30px;
    letter-spacing: -.02em;
    margin-top: 16px;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

/* ---- Grille cartes -------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 16px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
}

.card-sub {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}

.link {
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-display);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.link:hover {
    text-decoration: underline;
}

.seg {
    display: inline-flex;
    background: var(--bg-soft);
    border-radius: var(--r-full);
    padding: 3px;
    gap: 2px;
}

.seg button {
    border: 0;
    background: transparent;
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    font-family: var(--font-display);
}

.seg button.on {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-xs);
}

/* ---- Graphe --------------------------------------------------------- */
.chart-wrap {
    padding: 20px;
}

.chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-legend {
    display: flex;
    gap: 20px;
    padding: 0 20px 18px;
}

.leg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.leg i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: block;
}

/* ---- Liste des roues ------------------------------------------------ */
.wheel-list {
    padding: 8px 10px 12px;
    display: flex;
    flex-direction: column;
}

.wheel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: var(--r);
    transition: background .12s;
}

.wheel-row:hover {
    background: var(--bg-soft);
}

.wheel-row + .wheel-row {
    border-top: 1px solid var(--line);
    border-radius: 0;
}

.wheel-row:hover {
    border-radius: var(--r);
}

.chan {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: none;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-display);
    font-size: 13px;
}

.chan.google { background: #fff; border: 1px solid var(--line); }
.chan.insta { background: #e1306c; }
.chan.tiktok { background: #111827; }

.wheel-meta {
    flex: 1;
    min-width: 0;
}

.wheel-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wheel-info {
    font-size: 12px;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--font-display);
    padding: 4px 9px;
    border-radius: var(--r-full);
    flex: none;
}

.pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: block;
}

.pill.live { background: var(--success-bg); color: var(--success); }
.pill.live i { background: var(--success); }

.pill.paused { background: #fef3dd; color: #b9791a; }
.pill.paused i { background: var(--gold); }

.pill.draft { background: #eef1f7; color: var(--ink-2); }
.pill.draft i { background: var(--muted); }

/* ---- Table contacts ------------------------------------------------- */
.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    text-align: left;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 20px;
    background: var(--bg-soft);
    white-space: nowrap;
}

tbody td {
    padding: 13px 20px;
    border-top: 1px solid var(--line);
    white-space: nowrap;
}

tbody tr:hover {
    background: var(--bg-soft);
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.person-name {
    font-weight: 600;
    color: var(--ink);
}

.person-mail {
    font-size: 12px;
    color: var(--muted);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: var(--r-full);
    background: var(--bg-soft);
    color: var(--ink-2);
}

.stars {
    color: var(--gold);
    letter-spacing: 1px;
    font-size: 13px;
}

.won {
    font-weight: 600;
    color: var(--ink);
}

.won.none {
    color: var(--muted);
    font-weight: 400;
}

/* ============================================================
   Responsive
   ============================================================ */
.scrim {
    display: none;
}

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

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 284px;
        transform: translateX(-100%);
        transition: transform .24s ease;
        box-shadow: var(--shadow-lg);
    }

    .app.nav-open .sidebar {
        transform: translateX(0);
    }

    .app.nav-open .scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 27, 51, .38);
        z-index: 39;
    }

    .hamburger {
        display: grid;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 560px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px;
    }

    .topbar {
        padding: 0 16px;
    }

    .head-actions .btn-ghost {
        display: none;
    }

    /* Le menu notifications prend toute la largeur sous la topbar */
    .notif-menu {
        position: fixed;
        top: calc(var(--topbar-h) + 6px);
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================================
   Messages Flash
   ============================================================ */
.message {
    max-width: 1240px;
    margin: 0 auto 6px;
    padding: 12px 16px;
    border-radius: var(--r);
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
}

.message.success {
    background: var(--success-bg);
    color: #0f7a37;
    border-color: #bfe9cd;
}

.message.error {
    background: #fdeaea;
    color: #b42318;
    border-color: #f6cfcf;
}

.message.info,
.message.warning {
    background: var(--primary-050);
    color: var(--primary-strong);
    border-color: var(--primary-100);
}

/* ============================================================
   Formulaires (auth + onboarding)
   ============================================================ */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 7px;
}

.field .req {
    color: var(--primary);
}

.field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.field-hint {
    font-size: 12.5px;
    color: var(--primary);
    font-weight: 600;
}

.field-hint:hover {
    text-decoration: underline;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input::placeholder,
textarea::placeholder {
    color: #aab4c5;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

input.form-error,
input[aria-invalid="true"] {
    border-color: var(--danger);
}

.error-message {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 6px;
}

/* Champ avec icône collée (@) */
.input-icon {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.input-icon:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

.input-icon .ic {
    display: grid;
    place-items: center;
    padding: 0 12px;
    background: var(--bg-soft);
    color: var(--muted);
    font-weight: 600;
    border-right: 1px solid var(--line-strong);
}

.input-icon input {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
}

/* Case à cocher */
.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.45;
    margin: 4px 0 20px;
    cursor: pointer;
}

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

.check a {
    color: var(--primary);
    font-weight: 600;
}

.check a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14.5px;
}

/* ============================================================
   Auth — écran scindé (login)
   ============================================================ */
.auth-body {
    background: var(--bg);
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
}

/* Bouton retour (login / inscription) */
.auth-back {
    position: absolute;
    top: 22px;
    left: 22px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink-2);
    background: #fff;
    border: 1px solid var(--line-strong);
    padding: 8px 14px 8px 10px;
    border-radius: 100px;
    box-shadow: var(--shadow-xs);
    transition: transform .15s, border-color .15s, color .15s;
}
.auth-back:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateX(-2px);
}
.auth-back svg {
    width: 16px;
    height: 16px;
}

/* Flash au-dessus du formulaire d'authentification */
.split-inner .message,
.auth-card .message {
    margin-bottom: 16px;
}

.split-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.split-inner {
    width: 100%;
    max-width: 400px;
}

.brand-lg .wheel-mark {
    width: 34px;
    height: 34px;
}

.brand-lg .brand-name {
    font-size: 22px;
}

.auth-head {
    margin: 28px 0 24px;
}

.auth-head h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-head p {
    color: var(--muted);
    margin: 8px 0 0;
    font-size: 14.5px;
}

.auth-alt {
    text-align: center;
    margin: 22px 0 0;
    color: var(--ink-2);
    font-size: 14px;
}

.auth-alt a {
    color: var(--primary);
    font-weight: 600;
}

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

/* ============================================================
   Colonne visuelle (login / inscription) — DA vitrine
   ============================================================ */
.split-cover {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background:
        radial-gradient(680px 420px at 72% 6%, rgba(47, 107, 255, .5), transparent 60%),
        linear-gradient(160deg, #0b1130 0%, #101a44 55%, #1b2b6d 100%);
}

.cover-orb {
    position: absolute;
    width: 520px;
    height: 520px;
    right: -140px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 141, 255, .55), transparent 70%);
    filter: blur(30px);
    animation: coverOrb 9s ease-in-out infinite;
    pointer-events: none;
}

@keyframes coverOrb {
    0%, 100% { transform: translateY(0) scale(1); opacity: .85; }
    50% { transform: translateY(22px) scale(1.06); opacity: 1; }
}

.cover-dots {
    position: absolute;
    inset: 0;
    opacity: .5;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .28) 1px, transparent 1.6px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 72% 60% at 62% 45%, #000, transparent 76%);
    mask-image: radial-gradient(ellipse 72% 60% at 62% 45%, #000, transparent 76%);
}

.cover-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 56px;
    max-width: 550px;
    margin: auto 0;
}

.cover-badge {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    color: #cfe0ff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    padding: 6px 13px;
    border-radius: 100px;
    backdrop-filter: blur(6px);
    margin-bottom: 22px;
}

.cover-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
}

.cover-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 34px;
    line-height: 1.14;
    letter-spacing: -.02em;
    margin: 0 0 14px;
    color: #fff;
}

.cover-title span {
    background: linear-gradient(100deg, #7fb0ff, #b9d6ff 55%, #eaf2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cover-sub {
    color: rgba(226, 232, 255, .72);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 40px;
    max-width: 420px;
}

/* --- Cartes de preuve flottantes --- */
.cover-cards {
    position: relative;
    height: 240px;
    margin-bottom: 36px;
}

.cover-glass--review {
    position: relative;
    z-index: 2;
    width: 300px;
    background: rgba(255, 255, 255, .97);
    color: var(--ink);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 24px 50px rgba(4, 8, 30, .4);
}

.cg-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #eb5757, #f2994a);
    flex: none;
}

.cg-id strong {
    display: block;
    font-family: var(--font-display);
    font-size: 13.5px;
}

.cg-stars {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 1px;
}

.cg-google {
    margin-left: auto;
    display: inline-flex;
}

.cg-quote {
    margin: 12px 0 10px;
    font-size: 13.5px;
    color: var(--ink-2);
    font-style: italic;
}

.cg-auto {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(47, 107, 255, .10);
    padding: 5px 10px;
    border-radius: 100px;
}

.cover-glass--stat {
    position: absolute;
    z-index: 3;
    top: -22px;
    right: 4px;
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(150deg, var(--primary), #1b44cc);
    box-shadow: 0 20px 44px rgba(4, 8, 30, .4);
    --r: 3deg;
    transform: rotate(var(--r));
    animation: coverFloat 5s ease-in-out infinite;
}

.cg-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
}

.cg-lbl {
    font-size: 11.5px;
    opacity: .85;
    margin-top: 3px;
    max-width: 92px;
}

.cover-glass--rank {
    position: absolute;
    z-index: 4;
    bottom: -8px;
    left: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 250px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .97);
    color: var(--ink);
    box-shadow: 0 20px 44px rgba(4, 8, 30, .4);
    --r: -2deg;
    transform: rotate(var(--r));
    animation: coverFloat 5.6s ease-in-out infinite .6s;
}

.cg-rankpos {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    background: var(--primary);
    flex: none;
}

.cg-rankid strong {
    display: block;
    font-family: var(--font-display);
    font-size: 13px;
}

.cg-rankid span {
    font-size: 11.5px;
    color: var(--muted);
}

.cg-up {
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
    color: var(--success);
    background: rgba(22, 192, 152, .12);
    padding: 4px 8px;
    border-radius: 100px;
}

@keyframes coverFloat {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-10px) rotate(var(--r, 0deg)); }
}

.cover-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(226, 232, 255, .72);
    font-size: 13px;
    max-width: 380px;
}

.cover-faces {
    display: flex;
    flex: none;
}

.cover-faces span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-left: -8px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    color: #fff;
    background: var(--c, #2f80ed);
    border: 2px solid #101a44;
}

.cover-faces span:first-child { margin-left: 0; }
.cover-faces .more { background: rgba(255, 255, 255, .18); }

/* ============================================================
   Auth — carte centrée (inscription)
   ============================================================ */
.auth-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 34px;
}

.auth-card .auth-head {
    margin: 22px 0 22px;
}

.auth-card .auth-head h1 {
    font-size: 23px;
}

/* ============================================================
   Onboarding
   ============================================================ */
.onb {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.onb-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
}

.onb-quit {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
}

.onb-quit:hover {
    color: var(--ink);
}

/* Barre d'étapes */
.stepper {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 6px auto 0;
    padding: 0 20px;
    width: 100%;
    max-width: 620px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.step:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--line-strong);
    margin: 0 12px;
    border-radius: 2px;
    transition: background .2s;
}

.step.done:not(:last-child)::after {
    background: var(--primary);
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--line-strong);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    flex: none;
    transition: background .2s, border-color .2s, color .2s;
}

.step.active .step-num {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-050);
}

.step.done .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.step-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--ink);
}

.step.done .step-label {
    color: var(--ink-2);
}

.onb-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 60px;
}

.onb-form {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.onb-panel {
    display: none;
}

.onb-panel.active {
    display: block;
    animation: onbIn .28s ease;
}

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

.onb-panel h1 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 8px;
}

.onb-sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 22px;
    line-height: 1.5;
}

.onb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
}

.onb-spacer {
    flex: 1;
}

.onb-done {
    text-align: center;
    padding: 10px 0;
}

.onb-done-ico {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
}

.onb-done .onb-sub {
    margin-top: 8px;
}

/* ============================================================
   Responsive auth / onboarding
   ============================================================ */
@media (max-width: 900px) {
    .split {
        grid-template-columns: 1fr;
    }

    .split-cover {
        display: none;
    }
}

@media (max-width: 560px) {
    .field-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-card,
    .onb-form {
        padding: 24px;
    }

    .step-label {
        display: none;
    }

    .stepper {
        max-width: 280px;
    }
}

/* L'attribut hidden doit toujours l'emporter sur display des .btn */
[hidden] {
    display: none !important;
}

/* ============================================================
   Champ téléphone (sélecteur de pays + masque)
   ============================================================ */
.phone {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.phone:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

.phone-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    background: var(--bg-soft);
    border: 0;
    border-right: 1px solid var(--line-strong);
    border-radius: var(--r-sm) 0 0 var(--r-sm);
    font-size: 14px;
    color: var(--ink);
}

.phone-flag .flag {
    font-size: 18px;
    line-height: 1;
}

.phone-flag .dial {
    font-weight: 600;
}

.phone-flag svg {
    color: var(--muted);
}

.phone-input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.phone-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
}

.phone.open .phone-menu {
    display: block;
}

.phone-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    cursor: pointer;
}

.phone-opt:hover {
    background: var(--bg-soft);
}

.phone-opt .flag {
    font-size: 17px;
}

.phone-opt .dial-opt {
    margin-left: auto;
    color: var(--muted);
    font-weight: 600;
}

/* ============================================================
   Séparateur "ou" + bouton Google (login)
   ============================================================ */
.auth-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 12.5px;
}

.auth-sep::before,
.auth-sep::after {
    content: "";
    height: 1px;
    background: var(--line);
    flex: 1;
}

.btn-google {
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line-strong);
    color: var(--ink);
}

.btn-google:disabled {
    opacity: .8;
    cursor: not-allowed;
    color: var(--muted);
}

.btn-google .soon {
    margin-left: auto;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-2);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: var(--r-full);
}

/* ============================================================
   Mon compte — formulaires de réglages
   ============================================================ */
.account-card {
    max-width: 760px;
}

.card-body {
    padding: 22px 20px;
}

.card-body .field:last-child {
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 6px 0 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* Mention « optionnel » dans un intitulé de section. */
.section-title .opt {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--muted);
}

/* Note d'aide sous un intitulé (ex. explication d'un champ optionnel). */
.field-note {
    margin: -6px 0 14px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* ============================================================
   Roues — liste + formulaire
   ============================================================ */

/* Retour + entête */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--primary);
}

/* État vide */
.empty {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    padding: 52px 24px;
    text-align: center;
}

.empty-ico {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-050);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
}

.empty h2 {
    font-size: 19px;
    margin-bottom: 6px;
}

.empty p {
    color: var(--muted);
    max-width: 380px;
    margin: 0 auto 20px;
}

/* Cellules de la liste */
.roue-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.roue-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
}

.roue-type {
    font-size: 12px;
    color: var(--muted);
}

.chan.roue {
    background: var(--primary-050);
    color: var(--primary);
}

.chan.gratter {
    background: var(--gold-bg);
    color: #b9791a;
}

.lien-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lien-cell code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 12.5px;
    background: var(--bg-soft);
    color: var(--ink-2);
    padding: 3px 8px;
    border-radius: 6px;
}

.tag-ok {
    background: var(--success-bg);
    color: var(--success);
}

.col-actions {
    text-align: right;
}

.row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Petit bouton icône */
.mini-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    transition: background .12s, color .12s, border-color .12s;
}

.mini-btn:hover {
    background: var(--bg-soft);
    color: var(--ink);
    border-color: var(--line-strong);
}

.mini-btn.danger:hover {
    background: #fdeaea;
    color: var(--danger);
    border-color: #f6cfcf;
}

.mini-btn.copied {
    background: var(--success-bg);
    color: var(--success);
    border-color: #bfe9cd;
}

.table-roues td {
    vertical-align: middle;
}

/* Le thème DataTables + SweetAlert vit dans games.css (chargé après
   la CSS DataTables pour gagner en priorité). */

/* Modale QR */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qr-modal.open {
    display: flex;
}

.qr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 51, .42);
}

.qr-dialog {
    position: relative;
    width: 320px;
    max-width: 100%;
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 26px;
    text-align: center;
}

.qr-x {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
}

.qr-x:hover {
    background: var(--bg-soft);
}

.qr-title {
    font-size: 17px;
    margin-bottom: 4px;
}

.qr-sub {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 16px;
}

.qr-canvas {
    display: flex;
    justify-content: center;
    padding: 6px 0 18px;
}

.qr-canvas img,
.qr-canvas canvas {
    border-radius: 8px;
}

/* ---- Aide « lien d'avis Google » (déclencheur + modale) ------------ */
.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.field-label-row label {
    margin: 0;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .12s;
}

.help-link:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

.help-dialog {
    width: 540px;
    text-align: left;
    padding: 26px 28px;
}

.help-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 2px 0 20px;
}

.help-badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
}

.help-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    color: var(--ink);
    margin: 0 0 3px;
}

.help-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
}

.help-steps {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.help-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-050);
    color: var(--primary-strong);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
}

.help-step-txt {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.5;
}

.help-step-txt strong {
    display: block;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 2px;
}

.help-step-txt code {
    background: var(--bg-soft);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 12.5px;
    color: var(--ink);
}

.help-shot {
    display: block;
    width: 100%;
    max-width: 340px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-xs);
}

.help-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--primary-050);
    color: var(--ink-2);
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.help-note svg {
    flex: none;
    color: var(--primary);
    margin-top: 1px;
}

/* Formulaire roue */
.roue-form .page-head {
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

.form-main,
.form-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.field-help {
    font-size: 12.5px;
    color: var(--muted);
    margin: 7px 0 0;
}

/* Cartes de type de jeu */
.type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color .14s, background .14s;
}

.type-card:hover {
    border-color: var(--primary-100);
}

.type-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-050);
}

.type-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.type-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
}

.type-check {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--primary);
    opacity: 0;
    transition: opacity .14s;
}

.type-card input:checked ~ .type-check {
    opacity: 1;
}

/* Interrupteurs */
.switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
}

.switch + .switch {
    border-top: 1px solid var(--line);
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-ui {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    border-radius: var(--r-full);
    background: var(--line-strong);
    margin-top: 1px;
    transition: background .16s;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform .16s;
}

.switch input:checked + .switch-ui {
    background: var(--primary);
}

.switch input:checked + .switch-ui::after {
    transform: translateX(16px);
}

.switch-txt strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
}

.switch-txt small {
    color: var(--muted);
    font-size: 12.5px;
}

/* Options avancées de collecte */
.collect-adv {
    margin: 2px 0 6px 52px;
}

.adv-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12.5px;
    padding: 4px 0;
}

.adv-caret {
    transition: transform .16s;
}

.adv-toggle.open .adv-caret {
    transform: rotate(90deg);
}

.adv-body {
    padding: 6px 0 2px;
}

.adv-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 6px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    font-size: 13.5px;
    color: var(--ink-2);
    cursor: pointer;
}

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

/* Lots & probabilités */
.total-badge {
    font-size: 12.5px;
    color: var(--muted);
    background: var(--bg-soft);
    padding: 5px 12px;
    border-radius: var(--r-full);
    white-space: nowrap;
}

.total-badge strong {
    color: var(--ink);
}

.prize-list {
    margin-bottom: 12px;
}

.prize-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
}

.prize-row + .prize-row {
    border-top: 1px solid var(--line);
}

.prize-drag {
    color: #c4cddb;
    padding-top: 9px;
    flex: none;
}

.prize-fields {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 128px 104px;
    gap: 8px;
}

.prize-type {
    width: 100%;
    padding: 11px 10px;
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.prize-type:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

.prize-proba {
    position: relative;
}

.prize-proba .prize-pct {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
    pointer-events: none;
}

.prize-weight {
    padding-right: 30px !important;
}

.mini-btn[data-prize-remove] {
    margin-top: 4px;
}

/* Lien d'accès + QR inline */
.lien-box {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.lien-box input {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
}

.qr-inline {
    display: flex;
    justify-content: center;
    padding: 4px 0 14px;
}

.qr-inline img,
.qr-inline canvas {
    border-radius: 8px;
}

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

@media (max-width: 560px) {
    .type-cards {
        grid-template-columns: 1fr;
    }

    .prize-fields {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Statistiques
   ============================================================ */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    padding: 16px 18px;
    margin-bottom: 4px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.filter-field select,
.filter-field input[type="date"] {
    padding: 10px 12px;
    min-width: 170px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.filter-field select:focus,
.filter-field input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

.stat-label small {
    color: var(--muted);
    font-weight: 400;
}

.chart-box {
    position: relative;
    height: 320px;
    padding: 16px 20px 20px;
}

/* Répartition des lots */
.rep-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rep-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.rep-nom {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
}

.rep-total {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ink-2);
}

.rep-bar {
    height: 8px;
    background: var(--bg-soft);
    border-radius: var(--r-full);
    overflow: hidden;
}

.rep-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: var(--r-full);
}

/* ============================ Abonnement ============================ */
.abo-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 700;
}
.abo-status.is-active { background: var(--success-bg); color: var(--success); }
.abo-status.is-warn { background: var(--gold-bg); color: var(--gold); }
.abo-status.is-danger { background: #fdeaea; color: var(--danger); }
.abo-status.is-muted { background: var(--bg-soft); color: var(--muted); }

.abo-current { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.abo-current-plan { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.abo-plan-name { font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.abo-plan-price { color: var(--muted); font-weight: 600; }
.abo-current-meta { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.abo-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.usage-list { display: grid; gap: 16px; }
.usage-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
.usage-label { color: var(--ink-2); font-weight: 600; }
.usage-val { color: var(--muted); }
.rep-bar span.over { background: var(--danger); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.plan-card.is-current { border-color: var(--primary); background: var(--primary-050); }
.plan-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-cost { font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.plan-cost small { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-desc { font-size: 13px; color: var(--muted); }
.plan-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 13px; color: var(--ink-2); }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats li svg { flex: none; color: var(--success); margin-top: 1px; }
.plan-feats li.off { color: var(--muted); }
.plan-feats li.off svg { color: var(--muted); }
.plan-card .btn { margin-top: auto; }

.invoice-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.invoice-table th, .invoice-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.invoice-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.invoice-empty { color: var(--muted); font-size: 14px; }

/* ============================================================
   CTA Affiliation (sidebar) — sombre + orbe bleu
   ============================================================ */
.affil-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border-radius: var(--r);
    background: radial-gradient(120% 140% at 0% 0%, #16233f 0%, #0f1b33 55%, #0b1428 100%);
    overflow: hidden;
    isolation: isolate;
    box-shadow: var(--shadow-md);
    transition: transform .15s ease, box-shadow .15s ease;
}

.affil-cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.affil-cta.active {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.affil-cta__orb {
    position: absolute;
    z-index: -1;
    top: -40px;
    right: -30px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4f86ff 0%, #2563eb 45%, rgba(37, 99, 235, 0) 70%);
    filter: blur(6px);
    opacity: .85;
    animation: affilOrb 6s ease-in-out infinite;
}

@keyframes affilOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-8px, 8px) scale(1.08); }
}

.affil-cta__ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.affil-cta__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.affil-cta__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affil-cta__sub {
    font-size: 12px;
    color: #aebfe0;
}

.affil-cta__sub strong {
    color: #7fa9ff;
    font-weight: 700;
}

.affil-cta__arrow {
    flex: none;
    margin-left: auto;
    color: #8fa6d4;
    transition: transform .15s ease, color .15s ease;
}

.affil-cta:hover .affil-cta__arrow {
    transform: translateX(2px);
    color: #fff;
}

/* ============================================================
   Centre d'aide — Ticketing
   ============================================================ */

/* Fil d'ariane + séparateur */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--muted);
    font-weight: 600;
}

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

.dot-sep {
    color: var(--line-strong);
}

/* Filtres (chips) */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    transition: border-color .12s, background .12s, color .12s;
}

.chip:hover {
    border-color: var(--primary-100);
    color: var(--ink);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chip-count {
    font-size: 11.5px;
    font-weight: 700;
    background: var(--bg-soft);
    color: var(--ink-2);
    border-radius: var(--r-full);
    padding: 0 7px;
    min-width: 20px;
    text-align: center;
}

.chip.active .chip-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* Badges de statut */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11.5px;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-blue { background: var(--primary-050); color: var(--primary-strong); }
.badge-gold { background: var(--gold-bg); color: #a15c00; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-ink { background: var(--bg-soft); color: var(--ink-2); }
.badge-red { background: #fdeaea; color: var(--danger); }

/* Liste de tickets */
.ticket-list {
    padding: 6px;
}

.ticket-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 14px;
    border-radius: var(--r);
    transition: background .12s;
}

.ticket-row + .ticket-row {
    border-top: 1px solid var(--line);
}

.ticket-row:hover {
    background: var(--bg-soft);
}

.ticket-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ticket-top {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.ticket-ref {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .02em;
}

.ticket-sujet {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--muted);
}

.ticket-attente {
    color: var(--primary);
    font-weight: 600;
}

.ticket-chevron {
    color: var(--muted);
    flex: none;
}

/* Détail : conversation + aside */
.ticket-detail {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 18px;
    align-items: start;
}

.conversation {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.thread {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Bulles de conversation */
.bubble-row {
    display: flex;
    gap: 11px;
    max-width: 86%;
}

.bubble-row.client {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.bubble-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f86ff);
}

.bubble-avatar.support {
    background: var(--bg-soft);
}

.bubble-avatar.support .wheel-mark {
    width: 24px;
    height: 24px;
}

.bubble {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 14px;
    min-width: 0;
}

.bubble-row.client .bubble {
    background: var(--primary-050);
    border-color: var(--primary-100);
}

.bubble-head {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 4px;
}

.bubble-author {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--ink);
}

.bubble-time {
    font-size: 11px;
    color: var(--muted);
}

.bubble-text {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.bubble-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Puce de fichier (pièce jointe) */
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    transition: border-color .12s, box-shadow .12s;
    max-width: 220px;
}

.file-chip:hover {
    border-color: var(--primary-100);
    box-shadow: var(--shadow-xs);
}

.file-chip-ico {
    color: var(--primary);
    flex: none;
}

.file-chip-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-chip-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-size {
    font-size: 11px;
    color: var(--muted);
}

/* Zone de réponse */
.reply {
    border-top: 1px solid var(--line);
    padding: 14px 16px 16px;
}

.reply textarea {
    resize: vertical;
    min-height: 64px;
}

.reply-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.reply-spacer {
    flex: 1;
}

.reply-attach {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .12s, color .12s;
    max-width: 60%;
}

.reply-attach:hover {
    border-color: var(--primary-100);
    color: var(--primary);
}

.reply-attach-list {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-closed {
    border-top: 1px solid var(--line);
    padding: 18px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Zone d'ajout de fichiers (création) */
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--muted);
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
    text-align: center;
}

.file-drop:hover {
    border-color: var(--primary-100);
    background: var(--primary-050);
    color: var(--primary);
}

.file-drop-text {
    font-size: 13px;
    font-weight: 600;
}

.file-drop-list {
    font-size: 12px;
    color: var(--ink-2);
    word-break: break-all;
}

.field-hint-inline {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
}

/* Aside détails */
.ticket-aside {
    padding: 18px 20px;
}

.aside-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 14px;
}

.aside-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.aside-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aside-item dt {
    font-size: 12.5px;
    color: var(--muted);
}

.aside-item dd {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    text-align: right;
}

/* Selects (alignés sur les inputs) */
select {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    outline: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
}

@media (max-width: 900px) {
    .ticket-detail {
        grid-template-columns: 1fr;
    }
    .ticket-aside {
        order: -1;
    }
    .bubble-row {
        max-width: 100%;
    }
}

/* Type de jeu verrouillé (non inclus au plan) */
.type-card.is-locked { opacity: .6; cursor: not-allowed; }
.type-card.is-locked:hover { border-color: var(--line-strong); }
.type-lock { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.type-lock a { color: var(--primary); text-decoration: none; }
.type-lock a:hover { text-decoration: underline; }

/* ============================================================
   Select maison (fx-select)
   ============================================================ */
.fx-select {
    position: relative;
    width: 100%;
}

.fx-select .fx-native {
    display: none;
}

.fx-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
}

.fx-trigger:hover {
    border-color: var(--line);
}

.fx-select.fx-open .fx-trigger,
.fx-trigger:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-050);
    outline: none;
}

.fx-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-caret {
    flex: none;
    color: var(--muted);
    transition: transform .18s;
}

.fx-select.fx-open .fx-caret {
    transform: rotate(180deg);
}

.fx-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 70;
    min-width: 100%;
    width: max-content;
    max-width: min(340px, 88vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}

.fx-select.fx-open .fx-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fx-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, color .12s;
}

.fx-option:hover,
.fx-option.fx-hl {
    background: var(--bg-soft);
    color: var(--ink);
}

.fx-option.is-disabled {
    opacity: .45;
    cursor: default;
}

.fx-option[aria-selected="true"] {
    background: var(--primary-050);
    color: var(--primary-strong);
    font-weight: 600;
}

.fx-option[aria-selected="true"]::after {
    content: "";
    margin-left: auto;
    flex: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Le filtre des stats a besoin d'une largeur minimale confortable. */
.filter-field .fx-select {
    min-width: 180px;
}

/* ============================================================
   Concours — gestion (espace client)
   ============================================================ */

/* Interrupteur / ligne à cocher riche */
.switch-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 0 2px;
    cursor: pointer;
}

.switch-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex: none;
    cursor: pointer;
}

.switch-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
}

.switch-sub {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

/* Grille de cases à collecter */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}

.toggle-item:hover {
    border-color: var(--primary-100);
}

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

/* Lignes d'actions dynamiques */
.action-row {
    display: grid;
    grid-template-columns: 180px 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.action-row .action-type {
    width: 100%;
}

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

/* Aperçu de couverture */
.cover-preview {
    width: 100%;
    height: 150px;
    border-radius: var(--r-sm);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
    margin-bottom: 10px;
}

/* Bandeau lien public */
.lien-public-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
}

.lien-public-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
}

/* Carte de tirage */
.tirage-card {
    padding: 20px 22px;
}

.tirage-idle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tirage-idle-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

.tirage-idle-sub {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    max-width: 560px;
}

.tirage-winner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tirage-trophy {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--gold-bg);
    color: #a15c00;
    flex: none;
}

.tirage-winner-meta {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tirage-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: #a15c00;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.tirage-winner-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    color: var(--ink);
    letter-spacing: -.01em;
}

.tirage-winner-mail {
    font-size: 13px;
    color: var(--ink-2);
}

.tirage-date {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.tirage-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Ligne gagnante dans la table */
.row-winner {
    background: var(--gold-bg);
}

.row-winner:hover {
    background: var(--gold-bg);
}

/* Formulaire en ligne (bouton d'action confirmé par Swal) */
.inline-form {
    display: inline-flex;
    margin: 0;
}

/* Espacement entre les cartes d'un formulaire multi-sections */
.form-cards .card {
    margin-bottom: 18px;
}

.form-cards .card:last-of-type {
    margin-bottom: 0;
}

/* ===== Loader plein écran (redirection Stripe) — glassmorphism ===== */
.stripe-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 27, 51, .38);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    animation: stripe-fade .2s ease;
}
.stripe-loader.is-visible { display: flex; }
.stripe-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 34px 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 24px 60px rgba(16, 30, 54, .28), inset 0 1px 0 rgba(255, 255, 255, .7);
    text-align: center;
}
.stripe-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(37, 99, 235, .18);
    border-top-color: var(--primary);
    animation: stripe-spin .8s linear infinite;
}
.stripe-loader-text { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.stripe-loader-sub { font-size: 12.5px; color: var(--muted); }
@keyframes stripe-spin { to { transform: rotate(360deg); } }
@keyframes stripe-fade { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   Anti-zoom iOS : un champ dont la font-size < 16px déclenche
   un zoom automatique au focus sur mobile. On force 16px mini
   sur les champs de saisie en dessous de 640px de large.
   ========================================================= */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ============================================================
   Champ photo de profil (upload)
   ============================================================ */
.photo-field {
    display: flex;
    align-items: center;
    gap: 16px;
}

.photo-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-ph {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--muted);
}

.photo-actions {
    min-width: 0;
}

.photo-input {
    font-size: 13.5px;
    color: var(--ink-2);
    max-width: 100%;
}

.photo-input::file-selector-button {
    margin-right: 10px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.photo-input::file-selector-button:hover {
    background: var(--bg-soft);
    border-color: var(--line-strong);
}

.ws-photo-img {
    background-size: cover;
    background-position: center;
    color: transparent;
}

/* =========================================================
   Logo réel (sidebar + auth) : on remplace la pastille dessinée
   (.wheel-mark) et le texte (.brand-name) par le logo complet
   sur fond clair. Aucune vue à modifier.
   ========================================================= */
.brand .wheel-mark {
    width: 120px;
    height: 40px;
    border-radius: 0;
    background: url("../img/logo.png") left center / contain no-repeat;
    box-shadow: none;
}
.brand .wheel-mark::after { display: none; }
.brand .brand-name { display: none; }
.brand-lg .wheel-mark { width: 141px; height: 47px; }

/* =========================================================
   Champ mot de passe : bouton « œil » afficher / masquer
   ========================================================= */
.pwd-wrap {
    position: relative;
}
.pwd-wrap > input {
    padding-right: 44px;
}
.pwd-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    transition: color .15s, background .15s;
}
.pwd-toggle:hover {
    color: var(--ink);
    background: var(--bg);
}
.pwd-toggle.is-visible {
    color: var(--primary);
}

.plan-ttc { font-size: 12px; color: var(--muted); margin-top: -4px; }
