/* ═══════════════════════════════════════════
   ADMIN BACK-OFFICE — Stand-Up Academy
   Interface dashboard simple, lisible, dense.
   ═══════════════════════════════════════════ */

:root {
    --ad-bg:        #0d0703;
    --ad-bg-card:   #181009;
    --ad-bg-card-2: #1f140b;
    --ad-line:      rgba(255, 255, 255, 0.07);
    --ad-line-2:    rgba(255, 255, 255, 0.12);
    --ad-text:      #f0ece4;
    --ad-text-2:    #b9b1a1;
    --ad-text-3:    #8a8278;
    --ad-orange:    #f07a1a;
    --ad-orange-d:  #f14000;
    --ad-orange-l:  #fbb56a;
    --ad-green:     #6dc5b0;
    --ad-blue:      #6da9ff;
    --ad-yellow:    #f0c51a;
    --ad-red:       #ff5040;
    --ad-radius:    12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* L'attribut [hidden] doit toujours masquer l'élément, même si on a
   défini un display:flex/grid plus bas. */
[hidden] { display: none !important; }

body.ad-body {
    background:
        radial-gradient(800px 600px at 80% -10%, rgba(240, 122, 26, 0.08), transparent 70%),
        radial-gradient(900px 700px at 0% 100%, rgba(170, 78, 0, 0.06), transparent 70%),
        var(--ad-bg);
    color: var(--ad-text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ad-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 0.86em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ad-orange-l);
}

/* ═══════════════ LOGIN ═══════════════ */

.ad-login {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ad-login-back {
    position: absolute;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px 9px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--ad-text-2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.18s ease;
}
.ad-login-back:hover {
    color: #fff;
    background: rgba(240, 122, 26, 0.12);
    border-color: rgba(240, 122, 26, 0.35);
    transform: translateX(-2px);
}
.ad-login-back svg { flex-shrink: 0; }

@media (max-width: 520px) {
    .ad-login-back { top: 14px; left: 14px; padding: 8px 14px 8px 10px; font-size: 0.78rem; }
}

.ad-login-card {
    width: min(420px, 100%);
    padding: 36px 32px 32px;
    background:
        radial-gradient(500px 400px at 80% -20%, rgba(240, 122, 26, 0.15), transparent 70%),
        var(--ad-bg-card);
    border: 1px solid rgba(240, 122, 26, 0.3);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.ad-login-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 14px;
    background: rgba(240, 122, 26, 0.12);
    border: 1px solid rgba(240, 122, 26, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-login-logo img { width: 38px; height: 38px; object-fit: contain; }

.ad-login-card h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 1.5px;
    color: #fff;
    margin: 0 0 4px;
    text-align: center;
}

.ad-login-card > p {
    font-size: 0.86rem;
    color: var(--ad-text-2);
    text-align: center;
    margin: 0 0 26px;
}

.ad-login-form { display: flex; flex-direction: column; gap: 14px; }

.ad-field { display: flex; flex-direction: column; gap: 6px; }
.ad-field > span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ad-text-2);
    letter-spacing: 0.3px;
}
.ad-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ad-line-2);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s ease;
}
.ad-field input:focus {
    outline: none;
    border-color: var(--ad-orange);
}

.ad-login-error {
    margin: 0;
    color: var(--ad-red);
    font-size: 0.84rem;
    text-align: center;
}

.ad-login-hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--ad-text-3);
    text-align: center;
    line-height: 1.5;
}
.ad-login-hint small { color: var(--ad-text-3); opacity: 0.7; }

/* ═══════════════ BOUTONS ═══════════════ */

.ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

.ad-btn-primary {
    background: linear-gradient(135deg, var(--ad-orange), var(--ad-orange-d));
    color: #fff;
    box-shadow: 0 6px 20px rgba(240, 122, 26, 0.3);
    padding: 12px 16px;
    font-size: 0.9rem;
}
.ad-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(240, 122, 26, 0.45);
}

.ad-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ad-line-2);
    color: var(--ad-text);
}
.ad-btn-ghost:hover {
    background: rgba(240, 122, 26, 0.1);
    border-color: rgba(240, 122, 26, 0.4);
    color: var(--ad-orange-l);
}
.ad-btn-ghost.is-danger:hover {
    background: rgba(255, 80, 64, 0.1);
    border-color: rgba(255, 80, 64, 0.4);
    color: var(--ad-red);
}

/* ═══════════════ APP LAYOUT ═══════════════ */

.ad-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--ad-line);
    flex-wrap: wrap;
}

.ad-header-left { display: flex; align-items: center; gap: 14px; }

.ad-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(240, 122, 26, 0.1);
    border: 1px solid rgba(240, 122, 26, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-logo img { width: 26px; height: 26px; object-fit: contain; }

.ad-header-title { display: flex; flex-direction: column; line-height: 1.2; }
.ad-header-title span {
    font-size: 0.74rem;
    color: var(--ad-text-3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.ad-header-title strong {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: 1px;
}

.ad-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ═══════════════ STATS ═══════════════ */

.ad-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.ad-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 18px 16px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
}

.ad-stat.is-orange {
    background:
        linear-gradient(135deg, rgba(240, 122, 26, 0.14), rgba(240, 122, 26, 0.04));
    border-color: rgba(240, 122, 26, 0.3);
}

.ad-stat-label {
    font-size: 0.72rem;
    color: var(--ad-text-3);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
}

.ad-stat-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    color: #fff;
    line-height: 1;
    margin: 4px 0 0;
}

.ad-stat.is-orange .ad-stat-num { color: var(--ad-orange-l); }

.ad-stat-sub {
    font-size: 0.78rem;
    color: var(--ad-text-3);
}

/* ═══════════════ TOOLBAR ═══════════════ */

.ad-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
}

.ad-search {
    position: relative;
    flex: 1 1 280px;
    max-width: 420px;
}

.ad-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ad-text-3);
    pointer-events: none;
}

.ad-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line-2);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    transition: border-color 0.2s ease;
}
.ad-search input:focus {
    outline: none;
    border-color: var(--ad-orange);
}

.ad-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ad-chip {
    padding: 7px 12px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line-2);
    border-radius: 999px;
    color: var(--ad-text-2);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ad-chip:hover { color: #fff; border-color: var(--ad-line-2); }
.ad-chip.is-active {
    background: rgba(240, 122, 26, 0.16);
    border-color: rgba(240, 122, 26, 0.55);
    color: var(--ad-orange-l);
}
.ad-chip.is-status.is-active {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--ad-line-2);
    color: #fff;
}

/* ═══════════════ TABLEAU ═══════════════ */

.ad-table-wrap {
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    overflow: hidden;
    overflow-x: auto;
}

.ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ad-table thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ad-text-3);
    font-weight: 600;
    background: var(--ad-bg-card-2);
    border-bottom: 1px solid var(--ad-line);
    white-space: nowrap;
}

.ad-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ad-line);
    vertical-align: middle;
}

.ad-table tbody tr {
    transition: background 0.15s ease;
}
.ad-table tbody tr:hover {
    background: rgba(240, 122, 26, 0.04);
}
.ad-table tbody tr:last-child td { border-bottom: none; }

.ad-cell-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--ad-text-2);
    white-space: nowrap;
}

.ad-cell-person { display: flex; flex-direction: column; gap: 2px; }
.ad-cell-person strong { color: #fff; font-weight: 600; }
.ad-cell-person small { color: var(--ad-text-3); font-size: 0.74rem; }

.ad-cell-contact { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; }
.ad-cell-contact a { color: var(--ad-text); }
.ad-cell-contact small { color: var(--ad-text-3); font-size: 0.74rem; }

.ad-cell-offer { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.ad-cell-offer strong { color: #fff; font-weight: 600; }
.ad-cell-offer small {
    color: var(--ad-orange-l);
    font-weight: 600;
    font-size: 0.76rem;
}

.ad-cat-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    align-self: flex-start;
}
.ad-cat-badge.is-formation { background: rgba(216, 118, 255, 0.18); color: #e0a8ff; }
.ad-cat-badge.is-module    { background: rgba(240, 122, 26, 0.18); color: var(--ad-orange-l); }
.ad-cat-badge.is-cocon     { background: rgba(195, 154, 90, 0.2);  color: #d8b078; }
.ad-cat-badge.is-waitlist  { background: rgba(240, 197, 26, 0.18); color: #ffd17a; }
.ad-cat-badge.is-autre     { background: rgba(255, 255, 255, 0.08); color: var(--ad-text-2); }

.ad-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.ad-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.ad-status.is-nouveau   { background: rgba(240, 122, 26, 0.14); color: var(--ad-orange-l); border-color: rgba(240, 122, 26, 0.4); }
.ad-status.is-nouveau::before   { background: var(--ad-orange); }
.ad-status.is-contacte  { background: rgba(109, 169, 255, 0.14); color: var(--ad-blue); border-color: rgba(109, 169, 255, 0.4); }
.ad-status.is-contacte::before  { background: var(--ad-blue); }
.ad-status.is-confirme  { background: rgba(109, 197, 176, 0.14); color: var(--ad-green); border-color: rgba(109, 197, 176, 0.4); }
.ad-status.is-confirme::before  { background: var(--ad-green); }
.ad-status.is-refuse    { background: rgba(255, 80, 64, 0.12); color: var(--ad-red); border-color: rgba(255, 80, 64, 0.4); }
.ad-status.is-refuse::before    { background: var(--ad-red); }

.ad-cell-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.ad-icon-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--ad-line-2);
    border-radius: 8px;
    color: var(--ad-text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ad-icon-btn:hover {
    color: var(--ad-orange-l);
    border-color: rgba(240, 122, 26, 0.4);
    background: rgba(240, 122, 26, 0.08);
}
.ad-icon-btn.is-danger:hover {
    color: var(--ad-red);
    border-color: rgba(255, 80, 64, 0.4);
    background: rgba(255, 80, 64, 0.08);
}

.ad-table-empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--ad-text-2);
}
.ad-table-empty strong {
    display: block;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.ad-table-empty p { margin: 0; font-size: 0.88rem; }

/* ═══════════════ DRAWER (DETAIL) ═══════════════ */

.ad-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
}

.ad-drawer[hidden] { display: none; }

.ad-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: ad-fade 0.2s ease;
}

.ad-drawer-panel {
    position: relative;
    width: min(480px, 100vw);
    height: 100vh;
    background: var(--ad-bg-card);
    border-left: 1px solid var(--ad-line-2);
    overflow-y: auto;
    padding: 60px 30px 40px;
    animation: ad-slide 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes ad-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ad-slide {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.ad-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ad-line-2);
    border-radius: 10px;
    color: var(--ad-text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ad-drawer-close:hover {
    color: #fff;
    background: rgba(240, 122, 26, 0.16);
    border-color: rgba(240, 122, 26, 0.4);
}

.ad-detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ad-line);
}
.ad-detail-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--ad-text-3);
    margin-bottom: 8px;
}
.ad-detail-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 1px;
    line-height: 1;
    margin: 0 0 6px;
}
.ad-detail-date {
    font-size: 0.82rem;
    color: var(--ad-text-2);
}

.ad-detail-section { margin-bottom: 24px; }
.ad-detail-section h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ad-text-3);
    margin: 0 0 10px;
    font-weight: 700;
}

.ad-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ad-detail-item {
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    padding: 10px 14px;
}
.ad-detail-item small {
    display: block;
    font-size: 0.72rem;
    color: var(--ad-text-3);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.ad-detail-item strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
    word-break: break-word;
}
.ad-detail-item.is-full { grid-column: 1 / -1; }
.ad-detail-item a { color: var(--ad-orange-l); }

.ad-detail-message {
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ad-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.ad-detail-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ad-status-btn {
    padding: 7px 12px;
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line-2);
    border-radius: 999px;
    color: var(--ad-text-2);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ad-status-btn:hover { color: #fff; border-color: var(--ad-line-2); }
.ad-status-btn.is-current {
    background: rgba(240, 122, 26, 0.16);
    border-color: rgba(240, 122, 26, 0.55);
    color: var(--ad-orange-l);
}

/* ═══════════════ TABS ═══════════════ */

.ad-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--ad-line);
    padding: 0;
}

.ad-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ad-text-2);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-bottom: -1px;
}
.ad-tab:hover { color: #fff; }
.ad-tab.is-active {
    color: var(--ad-orange-l);
    border-bottom-color: var(--ad-orange);
}

.ad-tab-count {
    display: inline-block;
    min-width: 22px;
    padding: 1px 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ad-text-2);
    text-align: center;
}
.ad-tab.is-active .ad-tab-count {
    background: rgba(240, 122, 26, 0.2);
    color: var(--ad-orange-l);
}

.ad-panel { display: none; }
.ad-panel.is-active { display: block; }

.ad-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

/* ═══════════════ MODULES PANEL ═══════════════ */

.ad-mod-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 12px;
    margin-bottom: 22px;
    font-size: 0.84rem;
    color: var(--ad-text);
    line-height: 1.55;
}
.ad-mod-warning svg { color: #34c759; flex-shrink: 0; margin-top: 1px; }
.ad-mod-warning strong { color: #fff; display: block; margin-bottom: 3px; }
.ad-mod-warning em { font-style: italic; color: var(--ad-orange-l); font-weight: 600; }
.ad-mod-warning code {
    background: rgba(240, 122, 26, 0.12);
    color: var(--ad-orange-l);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.82em;
}

.ad-mod-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
}

.ad-mod-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ad-mod-group {
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: var(--ad-radius);
    padding: 18px 18px 22px;
}

.ad-mod-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ad-line);
}

.ad-mod-group-head h3 {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 1.2px;
}

.ad-mod-group-count {
    background: rgba(240, 122, 26, 0.16);
    color: var(--ad-orange-l);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(240, 122, 26, 0.3);
}

.ad-mod-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ad-mod-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 16px 14px;
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line);
    border-radius: 12px;
    transition: border-color 0.2s ease, transform 0.18s ease;
}
.ad-mod-card:hover {
    border-color: rgba(240, 122, 26, 0.4);
    transform: translateY(-2px);
}
.ad-mod-card.is-disabled {
    opacity: 0.55;
    border-style: dashed;
}

.ad-mod-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ad-mod-card-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(240, 122, 26, 0.18);
    color: var(--ad-orange-l);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.ad-mod-card-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--ad-text-3);
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 4px;
}

.ad-mod-card-off {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(255, 80, 64, 0.14);
    border: 1px solid rgba(255, 80, 64, 0.4);
    color: var(--ad-red);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
}

.ad-mod-card h4 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.ad-mod-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ad-text-2);
    line-height: 1.5;
}

.ad-mod-card-meta {
    font-size: 0.74rem;
    color: var(--ad-text-3);
    font-style: italic;
}

.ad-mod-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}
.ad-mod-card-chips span {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(240, 122, 26, 0.12);
    color: var(--ad-orange-l);
    font-weight: 500;
}

.ad-mod-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--ad-line);
}

.ad-mod-card-thumb {
    margin: -16px -16px 4px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--ad-line);
}
.ad-mod-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ad-mod-card:hover .ad-mod-card-thumb img {
    transform: scale(1.04);
}

.ad-mod-card-sessions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(240, 122, 26, 0.06);
    border: 1px solid rgba(240, 122, 26, 0.18);
    border-radius: 8px;
    font-size: 0.76rem;
    color: var(--ad-text-2);
}
.ad-mod-card-sessions svg {
    color: var(--ad-orange);
    flex-shrink: 0;
}
.ad-mod-card-sessions strong {
    color: var(--ad-orange-l);
    font-weight: 600;
}
.ad-mod-card-sessions small {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--ad-text-3);
    letter-spacing: 0.3px;
}
.ad-mod-card-sessions.is-empty {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--ad-line);
    border-style: dashed;
    color: var(--ad-text-3);
}
.ad-mod-card-sessions.is-empty svg {
    color: var(--ad-text-3);
}
.ad-mod-card-sessions-total {
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 7px;
    border-radius: 100px;
}

/* ═══════════════ EDITOR MODAL ═══════════════ */

.ad-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ad-modal[hidden] { display: none; }

.ad-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: ad-fade 0.2s ease;
}

.ad-modal-panel {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 32px 32px 28px;
    background:
        radial-gradient(500px 400px at 80% -20%, rgba(240, 122, 26, 0.1), transparent 70%),
        var(--ad-bg-card);
    border: 1px solid rgba(240, 122, 26, 0.3);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: ad-slide 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.ad-modal-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    letter-spacing: 1px;
    margin: 0 0 20px;
    padding-right: 40px;
    line-height: 1.1;
}

.ad-mod-form { display: flex; flex-direction: column; gap: 14px; }

.ad-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.ad-form-row:has(.ad-field:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }

.ad-mod-form .ad-field { display: flex; flex-direction: column; gap: 6px; }

.ad-mod-form .ad-field > span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ad-text-2);
    letter-spacing: 0.3px;
}
.ad-mod-form .ad-field > span em {
    color: var(--ad-orange);
    font-style: normal;
}
.ad-mod-form .ad-field > span small {
    color: var(--ad-text-3);
    font-weight: 400;
    margin-left: 4px;
    font-size: 0.85em;
}

.ad-mod-form .ad-field input,
.ad-mod-form .ad-field select,
.ad-mod-form .ad-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line-2);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s ease;
}
.ad-mod-form .ad-field input:focus,
.ad-mod-form .ad-field select:focus,
.ad-mod-form .ad-field textarea:focus {
    outline: none;
    border-color: var(--ad-orange);
}

.ad-mod-form .ad-field input[readonly] {
    color: var(--ad-text-3);
    background: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
}

.ad-mod-form .ad-field textarea { resize: vertical; min-height: 70px; font-family: inherit; }

.ad-mod-form .ad-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f07a1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.ad-mod-form .ad-field select option { background: #1a0a00; color: #fff; }

.ad-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line-2);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.18s ease;
}
.ad-form-checkbox:hover { border-color: var(--ad-line-2); }
.ad-form-checkbox input {
    accent-color: var(--ad-orange);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.ad-form-checkbox span { font-size: 0.86rem; color: var(--ad-text); font-weight: 500; }

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

.ad-mod-error {
    margin: 0;
    padding: 10px 12px;
    background: rgba(255, 80, 64, 0.1);
    border: 1px solid rgba(255, 80, 64, 0.4);
    border-radius: 8px;
    color: var(--ad-red);
    font-size: 0.84rem;
    font-weight: 500;
}

/* ═══════════════ FIELDSETS (image + sessions) ═══════════════ */

.ad-fieldset {
    border: 1px solid var(--ad-line-2);
    border-radius: 12px;
    padding: 16px 18px 18px;
    margin: 4px 0 0;
    background: rgba(255, 255, 255, 0.015);
}
.ad-fieldset legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line-2);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ad-text-2);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.ad-fieldset legend svg {
    color: var(--ad-orange);
}
.ad-fieldset-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: rgba(240, 122, 26, 0.18);
    border: 1px solid rgba(240, 122, 26, 0.4);
    border-radius: 100px;
    color: var(--ad-orange-l);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.ad-help {
    font-size: 0.78rem;
    color: var(--ad-text-3);
    margin: 0 0 12px;
    line-height: 1.5;
}
.ad-help strong { color: var(--ad-text-2); }
.ad-help code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.95em;
}

/* ─── Image preview + controls ─── */

.ad-image-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    align-items: stretch;
}

.ad-image-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(240, 122, 26, 0.05), rgba(240, 122, 26, 0.02)),
        var(--ad-bg-card-2);
    border: 1px dashed var(--ad-line-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-image-preview[data-empty="false"] { border-style: solid; }
.ad-image-empty {
    font-size: 0.78rem;
    color: var(--ad-text-3);
    letter-spacing: 0.3px;
}

.ad-image-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.ad-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Sessions list ─── */

.ad-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 12px;
}
.ad-sessions-list:empty {
    padding: 14px;
    border: 1px dashed var(--ad-line-2);
    border-radius: 8px;
    text-align: center;
}
.ad-sessions-list:empty::before {
    content: "Aucune session — clique sur « Ajouter une session » pour en créer.";
    color: var(--ad-text-3);
    font-size: 0.8rem;
}

.ad-session-row {
    display: grid;
    grid-template-columns: 1.1fr 0.7fr 0.7fr 1.2fr auto;
    gap: 8px;
    align-items: end;
    padding: 12px;
    background: var(--ad-bg-card-2);
    border: 1px solid var(--ad-line-2);
    border-radius: 10px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.ad-session-row:hover { border-color: rgba(240, 122, 26, 0.4); }
.ad-session-row.is-past {
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.015);
}
.ad-session-row.is-past::after {
    content: "Passée";
    grid-column: 1 / -1;
    margin-top: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ad-text-3);
}

.ad-session-row .ad-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.ad-session-row .ad-field > span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ad-text-3);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.ad-session-row input {
    width: 100%;
    padding: 8px 10px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line-2);
    border-radius: 7px;
    color: #fff;
    font-family: inherit;
    font-size: 0.84rem;
    transition: border-color 0.2s ease;
}
.ad-session-row input:focus {
    outline: none;
    border-color: var(--ad-orange);
}
.ad-session-row input[type="date"],
.ad-session-row input[type="time"] {
    color-scheme: dark;
}

.ad-session-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--ad-line-2);
    border-radius: 8px;
    color: var(--ad-text-3);
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: end;
}
.ad-session-remove:hover {
    color: var(--ad-red);
    border-color: rgba(255, 80, 64, 0.5);
    background: rgba(255, 80, 64, 0.08);
}

@media (max-width: 880px) {
    .ad-image-grid { grid-template-columns: 1fr; }
    .ad-session-row { grid-template-columns: 1fr 1fr; }
    .ad-session-remove { grid-column: 1 / -1; width: 100%; height: 32px; }
}

/* ═══════════════ PAGES TAB (visibilité) ═══════════════ */

.ad-pages-intro {
    max-width: 760px;
    margin: 0 0 24px;
    padding: 22px 26px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: 14px;
}
.ad-pages-intro h2 {
    font-family: 'Bebas Neue', sans-serif;
    color: #fff;
    font-size: 1.4rem;
    letter-spacing: 1px;
    margin: 0 0 8px;
}
.ad-pages-intro p {
    color: var(--ad-text-2);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 6px;
}
.ad-pages-intro p strong { color: #fff; }
.ad-pages-intro .ad-pages-help {
    margin-top: 8px;
    color: var(--ad-text-3);
    font-size: 0.78rem;
}
.ad-pages-intro code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 1px 6px;
    background: rgba(240, 122, 26, 0.08);
    border-radius: 5px;
    color: var(--ad-orange);
}

/* ═══════════════════════════════════════════════
   ADMISSIONS — formulaire + liste des sessions
   ═══════════════════════════════════════════════ */
.ad-adm-form {
    margin: 0 0 28px;
    padding: 22px 22px 18px;
    background: linear-gradient(180deg, rgba(255, 122, 47, 0.08), rgba(255, 122, 47, 0.02));
    border: 1px solid rgba(255, 122, 47, 0.22);
    border-radius: 16px;
}
.ad-adm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}
.ad-adm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.ad-adm-field.is-wide {
    grid-column: 1 / -1;
}
.ad-adm-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}
.ad-adm-label em {
    font-style: italic;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
}
.ad-adm-field input[type="text"],
.ad-adm-field input[type="date"],
.ad-adm-field select,
.ad-adm-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 10, 8, 0.6);
    color: #f4eae0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    line-height: 1.4;
    box-sizing: border-box;
}
.ad-adm-field textarea {
    resize: vertical;
    min-height: 56px;
}
.ad-adm-field input:focus,
.ad-adm-field select:focus,
.ad-adm-field textarea:focus {
    outline: none;
    border-color: rgba(255, 122, 47, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 122, 47, 0.18);
}
.ad-adm-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ad-adm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ad-adm-empty {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    font-style: italic;
}
.ad-adm-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.ad-adm-row.is-status-closed   { opacity: 0.6; }
.ad-adm-row.is-status-archived { opacity: 0.35; }
.ad-adm-row:hover {
    border-color: rgba(255, 122, 47, 0.32);
    background: rgba(255, 255, 255, 0.05);
}
.ad-adm-row-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 10px 14px;
    background: rgba(255, 122, 47, 0.12);
    border: 1px solid rgba(255, 122, 47, 0.4);
    color: #ff9d5a;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.ad-adm-row-tag strong {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: #f4eae0;
    margin-top: 2px;
}
.ad-adm-row-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ad-adm-row-title {
    font-size: 15px;
    font-weight: 600;
    color: #f4eae0;
}
.ad-adm-row-dates {
    font-size: 13px;
    color: rgba(244, 234, 224, 0.78);
}
.ad-adm-row-dates strong { color: #ffd28a; font-weight: 600; }
.ad-adm-row-meta {
    font-size: 12px;
    color: rgba(244, 234, 224, 0.5);
    line-height: 1.4;
}
.ad-adm-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ad-adm-row-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}
.ad-adm-row-status.is-open     { background: rgba(80, 220, 130, 0.14); color: #7ee5a3; }
.ad-adm-row-status.is-closed   { background: rgba(255, 200, 90, 0.14); color: #ffd28a; }
.ad-adm-row-status.is-archived { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.5); }

@media (max-width: 720px) {
    .ad-adm-grid { grid-template-columns: 1fr; }
    .ad-adm-row {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: left;
    }
    .ad-adm-row-tag { align-self: flex-start; }
    .ad-adm-row-actions { justify-content: flex-end; flex-wrap: wrap; }
}

/* ─── Bloc Réglages globaux (toggles divers : chatbot, etc.) ─── */
.ad-settings-block {
    margin: 0 0 24px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(64, 36, 110, 0.28), rgba(38, 22, 64, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
}
.ad-settings-title {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0.2px;
}
.ad-setting-row {
    /* Hérite des styles .ad-page-row mais avec un fond légèrement différent
       et seulement 3 colonnes (pas de bouton « Voir »). */
    background: rgba(255, 255, 255, 0.04);
    grid-template-columns: 22px 1fr auto;
}
.ad-setting-row-with-preview {
    /* Variante avec bouton « Aperçu » → 4 colonnes comme .ad-page-row */
    grid-template-columns: 22px 1fr auto auto;
}

/* ═══════════════ DIAGNOSTIC PAGES ═══════════════ */
.ad-pages-diag {
    margin: 14px 0 18px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ad-line);
    border-radius: 12px;
    display: grid;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    line-height: 1.5;
}
.ad-pages-diag[hidden] {
    display: none;
}
.ad-pages-diag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.ad-pages-diag-row strong {
    color: var(--ad-text-2);
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
}
.ad-pages-diag-row code {
    color: #ffae6c;
    background: rgba(240, 122, 26, 0.07);
    padding: 2px 8px;
    border-radius: 4px;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}
.ad-pages-diag-row code.is-ok {
    color: #5fc890;
    background: rgba(80, 200, 120, 0.08);
}
.ad-pages-diag-row code.is-err {
    color: #ff7060;
    background: rgba(255, 80, 64, 0.1);
}

/* ═══════════════ APERÇU LIVE DU HEADER ═══════════════ */
.ad-pages-live {
    margin-top: 28px;
    padding: 18px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: 14px;
}
.ad-pages-live-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.ad-pages-live-head h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}
.ad-pages-live-head p {
    margin: 0;
    color: var(--ad-text-3);
    font-size: 0.8rem;
}
.ad-pages-live-frame {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #0c0805;
    border: 1px solid var(--ad-line);
    height: 360px;
}
.ad-pages-live-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #0c0805;
}

/* ═══════════════ MODALE D'APERÇU CHATBOT (JIJI) ═══════════════ */
.ad-chatbot-preview {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ad-chatbot-preview[hidden] {
    display: none;
}
.ad-chatbot-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 6, 4, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: ad-chatbot-fade 0.25s ease;
}
.ad-chatbot-preview-shell {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    max-width: 100%;
    max-height: min(720px, calc(100vh - 48px));
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line-2);
    border-radius: 18px;
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ad-chatbot-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ad-chatbot-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ad-chatbot-pop {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.ad-chatbot-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--ad-line);
    background: linear-gradient(180deg, rgba(255, 122, 47, 0.08) 0%, transparent 100%);
}
.ad-chatbot-preview-titles h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.ad-chatbot-preview-titles p {
    margin: 0;
    color: var(--ad-text-3);
    font-size: 0.78rem;
    line-height: 1.4;
}
.ad-chatbot-preview-close {
    appearance: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ad-chatbot-preview-close:hover {
    background: rgba(255, 80, 64, 0.16);
    border-color: rgba(255, 80, 64, 0.45);
    color: #fff;
}

.ad-chatbot-preview-body {
    flex: 1;
    min-height: 460px;
    position: relative;
    background: #0c0805;
}
.ad-chatbot-preview-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.ad-chatbot-preview-body[data-loading="1"]::before {
    content: "Chargement de Jiji…";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    font-family: 'Inter', system-ui, sans-serif;
}

.ad-chatbot-preview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--ad-line);
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.72rem;
    color: var(--ad-text-3);
}
.ad-chatbot-preview-character code {
    color: rgba(255, 174, 108, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    background: rgba(255, 122, 47, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}
.ad-chatbot-preview-open-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffae6c;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.7rem;
    transition: color 0.2s ease;
}
.ad-chatbot-preview-open-new:hover {
    color: #ffd1a8;
}

@media (max-width: 520px) {
    .ad-chatbot-preview {
        padding: 0;
    }
    .ad-chatbot-preview-shell {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
.ad-setting-row .ad-page-info small {
    color: rgba(255, 255, 255, 0.6);
}

.ad-pages-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.ad-pages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.ad-page-row {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ad-page-row:hover {
    border-color: var(--ad-line-2);
    background: var(--ad-bg-card-2);
}
.ad-page-row.is-hidden {
    border-color: rgba(255, 80, 64, 0.25);
    background: rgba(255, 80, 64, 0.03);
    opacity: 0.85;
}

.ad-page-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--ad-orange);
    cursor: pointer;
    margin: 0;
}

.ad-page-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.ad-page-info strong {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}
.ad-page-info small {
    color: var(--ad-text-3);
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
}

.ad-page-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(80, 200, 120, 0.12);
    color: #5fc890;
    border: 1px solid rgba(80, 200, 120, 0.25);
}
.ad-page-row.is-saving {
    opacity: 0.7;
    pointer-events: none;
    border-color: rgba(240, 122, 26, 0.4);
    background: rgba(240, 122, 26, 0.05);
}
.ad-page-row.is-saving .ad-page-status {
    background: rgba(240, 122, 26, 0.18);
    color: #ffae6c;
    border-color: rgba(240, 122, 26, 0.4);
}
.ad-page-row.is-error {
    border-color: rgba(255, 69, 58, 0.6);
    background: rgba(255, 69, 58, 0.08);
}
.ad-page-row.is-error .ad-page-status {
    background: rgba(255, 69, 58, 0.2);
    color: #ff7a72;
    border-color: rgba(255, 69, 58, 0.55);
}
.ad-page-row.is-hidden .ad-page-status {
    background: rgba(255, 80, 64, 0.12);
    color: #ff7060;
    border-color: rgba(255, 80, 64, 0.3);
}

/* — Bouton « Voir » (aperçu de la page, même masquée) — */
.ad-page-row-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ad-page-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(240, 122, 26, 0.08);
    border: 1px solid rgba(240, 122, 26, 0.28);
    color: #ffae6c;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.ad-page-preview:hover {
    background: rgba(240, 122, 26, 0.16);
    border-color: rgba(240, 122, 26, 0.55);
    color: #ffd1a8;
    transform: translateY(-1px);
}
.ad-page-preview svg {
    flex-shrink: 0;
}
.ad-page-row.is-hidden .ad-page-preview {
    background: rgba(255, 80, 64, 0.08);
    border-color: rgba(255, 80, 64, 0.35);
    color: #ffb5ad;
}
.ad-page-row.is-hidden .ad-page-preview:hover {
    background: rgba(255, 80, 64, 0.18);
    border-color: rgba(255, 80, 64, 0.65);
    color: #fff;
}

@media (max-width: 720px) {
    .ad-page-row {
        grid-template-columns: 22px 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 10px;
    }
    .ad-page-status {
        grid-column: 3;
        grid-row: 1;
    }
    .ad-page-preview {
        grid-column: 2 / 4;
        grid-row: 2;
        justify-self: start;
    }
}

/* ═══════════════ RESPONSIVE ═══════════════ */

@media (max-width: 1100px) {
    .ad-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 880px) {
    .ad-form-row { grid-template-columns: 1fr; }
    .ad-mod-group-grid { grid-template-columns: 1fr; }
    .ad-pages-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .ad-stats { grid-template-columns: repeat(2, 1fr); }
    .ad-table thead { display: none; }
    .ad-table, .ad-table tbody, .ad-table tr, .ad-table td { display: block; width: 100%; }
    .ad-table tbody tr {
        margin-bottom: 12px;
        background: var(--ad-bg-card-2);
        border-radius: 10px;
        padding: 8px;
    }
    .ad-table tbody td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--ad-line);
    }
    .ad-table tbody td:last-child { border-bottom: none; }
    .ad-detail-grid { grid-template-columns: 1fr; }
    .ad-drawer-panel { width: 100vw; padding: 60px 22px 40px; }
}

/* ════════════════════════════════════════════════
   VISUELS — Catalogue + Génération IA
   ════════════════════════════════════════════════ */
.ad-img-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.ad-img-grid {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ad-img-page-group {
    background: var(--ad-bg-card);
    border: 1px solid var(--ad-line);
    border-radius: 16px;
    padding: 20px 22px 24px;
}

.ad-img-page-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.35rem;
    letter-spacing: 1px;
    color: #fff;
    margin: 0 0 16px;
}
.ad-img-page-title span {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0;
    color: var(--ad-text-3);
    margin-left: 8px;
    font-weight: 400;
}

.ad-img-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.ad-img-card {
    position: relative;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--ad-line);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
}
.ad-img-card:hover, .ad-img-card:focus-visible {
    border-color: rgba(240, 122, 26, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    outline: none;
}
.ad-img-card.has-override {
    border-color: rgba(52, 199, 89, 0.5);
}
.ad-img-card.is-selected {
    border-color: var(--ad-orange, #f07a1a);
    box-shadow: 0 0 0 1px var(--ad-orange, #f07a1a), 0 10px 24px rgba(240, 122, 26, 0.18);
}
.ad-img-card.is-generating .ad-img-card-thumb img {
    opacity: 0.55;
    filter: saturate(0.8);
}

/* Checkbox dans la carte */
.ad-img-card-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: block;
}
.ad-img-card-check input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}
.ad-img-card-check-box {
    position: absolute;
    inset: 0;
    border-radius: 7px;
    background: rgba(15, 12, 20, 0.78);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.16s, border-color 0.16s;
}
.ad-img-card-check-box svg {
    width: 16px;
    height: 16px;
    color: #fff;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.16s, transform 0.16s;
}
.ad-img-card-check input:checked ~ .ad-img-card-check-box {
    background: var(--ad-orange, #f07a1a);
    border-color: var(--ad-orange, #f07a1a);
}
.ad-img-card-check input:checked ~ .ad-img-card-check-box svg {
    opacity: 1;
    transform: scale(1);
}
.ad-img-card:hover .ad-img-card-check-box {
    border-color: rgba(255, 255, 255, 0.8);
}

/* Spinner de la carte pendant une génération en cours */
.ad-img-card-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.ad-img-card-spinner svg {
    width: 36px;
    height: 36px;
    color: var(--ad-orange, #f07a1a);
    animation: ad-img-spin 0.9s linear infinite;
}
@keyframes ad-img-spin {
    to { transform: rotate(360deg); }
}

/* ─── Barre de sélection ─── */
.ad-img-selection-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    margin: 8px 0 10px;
    background: linear-gradient(135deg, rgba(240, 122, 26, 0.16), rgba(240, 122, 26, 0.08));
    border: 1px solid rgba(240, 122, 26, 0.42);
    border-radius: 12px;
    backdrop-filter: blur(6px);
}
.ad-img-sel-info {
    color: #fff;
    font-size: 0.92rem;
}
.ad-img-sel-info strong {
    color: var(--ad-orange, #f07a1a);
    font-weight: 700;
    font-size: 1.05rem;
}
.ad-img-sel-cost {
    margin-left: 8px;
    color: var(--ad-text-2, #c5b9cd);
    font-size: 0.82rem;
}
.ad-img-sel-actions {
    display: flex;
    gap: 8px;
}
.ad-img-sel-helper {
    margin: 0 0 14px;
    font-size: 0.8rem;
    color: var(--ad-text-3, #8a7e94);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ad-link-btn {
    background: none;
    border: none;
    color: var(--ad-orange, #f07a1a);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}
.ad-link-btn:hover { opacity: 0.85; }
.ad-img-sel-tip { opacity: 0.85; }

/* ─── Modale génération groupée ─── */
.ad-img-bulk-controls {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.ad-img-bulk-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    padding: 12px 14px;
}
.ad-img-bulk-summary > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ad-img-bulk-summary span {
    color: var(--ad-text-3, #8a7e94);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ad-img-bulk-summary strong {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-img-bulk-progress {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(15, 12, 20, 0.4);
    border: 1px solid var(--ad-line);
    border-radius: 10px;
    padding: 6px;
}
.ad-img-bulk-progress:empty { display: none; }

.ad-img-bulk-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
    color: var(--ad-text-2, #c5b9cd);
    border-left: 3px solid transparent;
    margin: 2px;
    transition: background 0.18s ease;
}
.ad-img-bulk-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ad-img-bulk-item-error {
    color: #ff9d96;
    font-size: 0.74rem;
    line-height: 1.4;
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.18);
    padding: 6px 8px;
    border-radius: 5px;
    word-break: break-word;
}
.ad-img-bulk-item-name {
    color: #fff;
    font-weight: 500;
}
.ad-img-bulk-item-status {
    font-size: 0.78rem;
    color: var(--ad-text-3, #8a7e94);
    font-variant-numeric: tabular-nums;
    text-align: right;
    max-width: 50%;
}
.ad-img-bulk-item.is-pending {
    border-left-color: rgba(255, 255, 255, 0.15);
}
.ad-img-bulk-item.is-running {
    border-left-color: var(--ad-orange, #f07a1a);
    background: rgba(240, 122, 26, 0.08);
}
.ad-img-bulk-item.is-running .ad-img-bulk-item-status {
    color: var(--ad-orange, #f07a1a);
}
.ad-img-bulk-item.is-ok {
    border-left-color: #34c759;
    background: rgba(52, 199, 89, 0.07);
}
.ad-img-bulk-item.is-ok .ad-img-bulk-item-status {
    color: #34c759;
}
.ad-img-bulk-item.is-error {
    border-left-color: #ff453a;
    background: rgba(255, 69, 58, 0.07);
}
.ad-img-bulk-item.is-error .ad-img-bulk-item-status {
    color: #ff7a72;
}

.ad-btn.is-danger {
    color: #ff7a72;
}
.ad-btn.is-danger:hover {
    background: rgba(255, 69, 58, 0.1);
}

@media (max-width: 720px) {
    .ad-img-selection-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ad-img-bulk-controls {
        grid-template-columns: 1fr;
    }
}

.ad-img-card-thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #0f0c14 url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect fill='%23191522' width='100' height='100'/%3E%3C/svg%3E") center/cover;
    overflow: hidden;
}
.ad-img-card.is-portrait .ad-img-card-thumb { aspect-ratio: 2 / 3; }
.ad-img-card.is-square .ad-img-card-thumb   { aspect-ratio: 1 / 1; }
.ad-img-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-img-card-thumb .ad-image-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ad-text-3);
    font-size: 0.78rem;
}

.ad-img-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: rgba(52, 199, 89, 0.95);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-radius: 6px;
    z-index: 2;
}
.ad-img-badge.ad-img-badge-flip {
    right: auto;
    left: 42px;
    top: 8px;
    background: rgba(139, 92, 246, 0.95);
}

/* Bouton flip rapide sur la carte (coin haut droit) */
.ad-img-card-flip {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 12, 20, 0.78);
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s;
    backdrop-filter: blur(4px);
    opacity: 0;
}
.ad-img-card:hover .ad-img-card-flip,
.ad-img-card:focus-within .ad-img-card-flip,
.ad-img-card-flip[aria-pressed="true"] {
    opacity: 1;
}
.ad-img-card-flip svg {
    width: 16px;
    height: 16px;
}
.ad-img-card-flip:hover {
    border-color: rgba(139, 92, 246, 0.6);
    color: #fff;
    transform: scale(1.05);
}
.ad-img-card-flip[aria-pressed="true"] {
    background: rgba(139, 92, 246, 0.92);
    border-color: rgba(139, 92, 246, 0.92);
    color: #fff;
}
.ad-img-card-flip:disabled {
    opacity: 0.5;
    cursor: wait;
}
.ad-img-card.has-override .ad-img-badge:not(.ad-img-badge-flip) {
    /* Quand on a override + flip, on déplace le badge "Personnalisé" vers le bas */
}
.ad-img-card.has-override.is-flipped .ad-img-badge:not(.ad-img-badge-flip) {
    top: auto;
    bottom: 8px;
}

.ad-img-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ad-img-card-body strong {
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
}
.ad-img-card-key {
    color: var(--ad-text-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ─── Modal éditeur ─── */
.ad-modal-wide {
    width: min(1080px, 96vw);
    max-height: 92vh;
}

.ad-img-editor-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    align-items: start;
}

.ad-img-editor-preview {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-img-preview-wrap {
    position: relative;
    background: #0f0c14;
    border: 1px solid var(--ad-line);
    border-radius: 12px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-img-preview-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}
.ad-img-preview-wrap .ad-image-empty {
    color: var(--ad-text-3);
    font-size: 0.85rem;
}

.ad-img-preview-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
#ad-img-flip {
    flex: 1;
    justify-content: center;
}
#ad-img-flip.is-active {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.55);
    color: #c4b5fd;
}
#ad-img-flip.is-active:hover {
    background: rgba(139, 92, 246, 0.24);
}

.ad-img-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--ad-text);
}
.ad-img-meta > div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--ad-line);
}
.ad-img-meta > div:last-child { border-bottom: none; }
.ad-img-meta span { color: var(--ad-text-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; }
.ad-img-meta code {
    background: rgba(240, 122, 26, 0.08);
    color: var(--ad-orange-l);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
}

.ad-img-editor-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ad-img-editor-form textarea {
    width: 100%;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid var(--ad-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 160px;
}
.ad-img-editor-form textarea:focus {
    border-color: rgba(240, 122, 26, 0.55);
    outline: none;
}

.ad-img-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ad-img-editor-form select {
    width: 100%;
    padding: 9px 11px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid var(--ad-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.86rem;
}

.ad-img-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.ad-img-status {
    margin: 0;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 0.82rem;
    line-height: 1.4;
}
.ad-img-status.is-info { background: rgba(53, 122, 240, 0.12); border: 1px solid rgba(53, 122, 240, 0.35); color: #b9d2ff; }
.ad-img-status.is-ok   { background: rgba(52, 199, 89, 0.12); border: 1px solid rgba(52, 199, 89, 0.35); color: #b6f0c8; }
.ad-img-status.is-err  { background: rgba(255, 80, 80, 0.12); border: 1px solid rgba(255, 80, 80, 0.40); color: #ffb6b6; }

@media (max-width: 900px) {
    .ad-img-editor-body { grid-template-columns: 1fr; }
    .ad-img-field-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   RÉFÉRENCES DU LIEU (panel + grid + checkbox de toggle)
   ═══════════════════════════════════════════════════════ */
.ad-venue-refs {
    margin: 24px 0 8px;
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, rgba(64, 36, 110, 0.32), rgba(38, 22, 64, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
}
.ad-venue-refs-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ad-venue-refs-head h3 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    color: #fff;
    letter-spacing: 0.2px;
}
.ad-venue-refs-head p {
    margin: 0;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    line-height: 1.55;
}
.ad-venue-refs-head em {
    color: #f7c071;
    font-style: italic;
}
.ad-venue-refs-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.ad-venue-refs-count {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.ad-venue-refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.ad-venue-refs-empty {
    grid-column: 1 / -1;
    padding: 22px 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.84rem;
}
.ad-venue-ref-card {
    position: relative;
    background: rgba(15, 12, 20, 0.5);
    border: 1px solid var(--ad-line, rgba(255,255,255,0.08));
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
}
.ad-venue-ref-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-venue-ref-card.is-uploading {
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.04);
    border-style: dashed;
}
.ad-venue-ref-actions {
    position: absolute;
    inset: auto 8px 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}
.ad-venue-ref-label {
    pointer-events: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    font-size: 0.72rem;
    line-height: 1.2;
    cursor: text;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ad-venue-ref-label[contenteditable="true"]:focus {
    outline: 1px solid rgba(240, 122, 26, 0.6);
    background: rgba(0, 0, 0, 0.75);
    white-space: normal;
}
.ad-venue-ref-del {
    pointer-events: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ff9a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.ad-venue-ref-del:hover {
    background: rgba(255, 60, 60, 0.85);
    color: #fff;
    transform: scale(1.05);
}

/* ─── Checkbox « régénérer dans le vrai lieu » ─── */
.ad-field-check {
    display: flex;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(240, 122, 26, 0.07);
    border: 1px solid rgba(240, 122, 26, 0.25);
    border-radius: 10px;
    margin-top: 6px;
}
.ad-field-check input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #f07a1a;
    cursor: pointer;
}
.ad-field-check > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.35;
}
.ad-field-check small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.74rem;
    line-height: 1.45;
}
.ad-field-check small code {
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.72rem;
}
.ad-field-check.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.ad-field-check.is-disabled input { cursor: not-allowed; }
