/* ============================================
   ADMIN DASHBOARD — TARDIS Shop
   ============================================ */

.admin-body {
    background: var(--bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

.admin-body .stars,
.admin-body .stars-2,
.admin-body .stars-3 {
    opacity: 0.15;
}

/* ========== LOADER ========== */
.admin-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: var(--bg-dark);
    z-index: 1000;
    color: var(--text-secondary);
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(96, 165, 250, 0.15);
    border-top-color: var(--tardis-blue-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== ACCESS DENIED ========== */
.admin-denied {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.denied-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.denied-icon {
    width: 80px;
    height: 80px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.denied-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

.denied-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.denied-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== LAYOUT ========== */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ========== SIDEBAR ========== */
.admin-sidebar {
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--tardis-blue-bright);
}

.sidebar-brand strong {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.sidebar-brand span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(88, 101, 242, 0.12));
    color: var(--tardis-blue-bright);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--tardis-blue-bright);
    border-radius: 0 3px 3px 0;
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.nav-item.active .nav-badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--tardis-blue-bright);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.15s;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.sidebar-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-info strong {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info span {
    font-size: 11px;
    color: var(--gold);
    font-weight: 500;
}

/* ========== MAIN ========== */
.admin-main {
    padding: 32px;
    max-width: 1400px;
    width: 100%;
    overflow-x: hidden;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.view-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.view-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ========== STAT CARDS ========== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(88, 101, 242, 0.12));
    color: var(--tardis-blue-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon-gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 165, 0, 0.12));
    color: var(--gold);
}

.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== PANELS ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: #131826;
    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 12, 24, 0.45);
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.panel-body {
    padding: 16px 20px;
    background: transparent;
}

.panel-body.no-padding {
    padding: 0;
}

/* ========== ECONOMY MEMBERS — toolbar + pagination ========== */
.members-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.members-search {
    flex: 1 1 220px;
    min-width: 200px;
}
.members-search input[type="search"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: inherit;
    font: inherit;
    outline: none;
}
.members-search input[type="search"]:focus {
    border-color: var(--tardis-blue-bright, #3b82f6);
    background: rgba(255, 255, 255, 0.06);
}
.members-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.members-sort label {
    color: var(--muted, rgba(255,255,255,0.6));
}
.members-sort select {
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.members-meta {
    margin-left: auto;
    color: var(--muted, rgba(255,255,255,0.55));
    font-size: 12px;
}
.members-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.members-pageinfo {
    font-size: 13px;
    color: var(--muted, rgba(255,255,255,0.7));
    min-width: 110px;
    text-align: center;
}
.data-row-orphan {
    opacity: 0.7;
}
.row-tag-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ========== ECONOMY MEMBERS — style "cartes" comme le leaderboard ========== */
#economyTable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: transparent;
}
.member-item {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.member-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 12px;
    background: #2b2d35;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s, transform 0.15s, border-radius 0.15s;
    cursor: pointer;
    outline: none;
}
.member-item.is-expanded .member-row {
    border-radius: 18px 18px 0 0;
    background: #34363f;
    border-color: rgba(217, 119, 85, 0.35);
}
.member-row:hover {
    background: #34363f;
}
.member-row:focus-visible {
    background: #34363f;
    border-color: rgba(217, 119, 85, 0.5);
}
.member-expand {
    background: #23252c;
    border: 1px solid rgba(217, 119, 85, 0.28);
    border-top: none;
    border-radius: 0 0 18px 18px;
    padding: 16px 18px 18px;
}
.member-expand-meta {
    margin: 0 0 12px;
    font-size: 12px;
}
.member-detail-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.member-detail-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.member-detail-progression {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
}
.member-detail-progression-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 8px;
}
.member-detail-level {
    font-weight: 800;
    color: #f4b183;
    font-size: 15px;
}
.member-detail-xp {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}
.member-detail-xp-next {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}
.member-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.member-progress-track--sm {
    height: 6px;
}
.member-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d97755, #f4b183);
    transition: width 0.25s ease;
}
.member-progress-fill.is-full {
    background: linear-gradient(90deg, #22c55e, #86efac);
}
.stat-value--gain {
    color: #86efac;
}
.member-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.member-tab {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.member-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
}
.member-tab.is-active {
    background: rgba(217, 119, 85, 0.22);
    color: #fff;
}
.member-tab-panel {
    min-height: 40px;
}
.member-tab-panel[hidden] {
    display: none !important;
}
.member-daily-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.member-daily-header .member-detail-section-title {
    margin: 0;
}
.member-daily-total {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}
.member-daily-total strong {
    color: #86efac;
}
.member-daily-tiers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.member-daily-tier {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
}
.member-daily-tier.is-disabled {
    opacity: 0.55;
}
.member-daily-tier-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}
.member-daily-tier-label {
    font-weight: 700;
    color: #fff;
}
.member-daily-tier-amount {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    white-space: nowrap;
}
.member-daily-tier-remain {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}
.member-tier-off {
    color: rgba(255, 255, 255, 0.35);
    font-size: 10px;
    text-transform: uppercase;
}
.member-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}
.member-history-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.member-history-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.member-history-type {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.45);
}
.member-history-row.hist-purchase .member-history-type { color: #f87171; }
.member-history-row.hist-daily .member-history-type { color: #86efac; }
.member-history-row.hist-earn .member-history-type { color: #93c5fd; }
.member-history-label {
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-history-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}
.member-history-right {
    text-align: right;
    flex-shrink: 0;
}
.member-history-amount {
    display: block;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
}
.member-history-row.hist-purchase .member-history-amount { color: #fca5a5; }
.member-history-row.hist-daily .member-history-amount,
.member-history-row.hist-earn .member-history-amount { color: #86efac; }
.member-history-date {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}
.member-inv-group {
    margin-bottom: 14px;
}
.member-inv-group:last-child {
    margin-bottom: 0;
}
.member-inv-group-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.member-inv-group-title span {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
}
.coin-ops {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.coin-ops-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 12px 14px;
}
.coin-ops-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 10px;
}
.coin-ops-quicks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.coin-ops-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.coin-ops-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    padding: 8px 12px;
    font: inherit;
    font-size: 14px;
}
.coin-ops-input:focus {
    outline: none;
    border-color: rgba(217, 119, 85, 0.55);
}
.coin-ops-hint {
    margin: 8px 0 0;
}
@media (max-width: 720px) {
    .coin-ops {
        grid-template-columns: 1fr;
    }
}
.member-row-orphan {
    opacity: 0.65;
}
.member-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.member-avatar img,
.member-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #1f2127;
    color: #e5e7eb;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d97755;
}
.member-rank {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #d04a3b;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2b2d35;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.member-rank-warn {
    background: #b45309;
}
.member-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.member-name {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}
.member-id code,
.member-id .member-id-code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 11px;
}
.member-handle,
.row-handle {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 500;
    margin-right: 8px;
}
.member-id .member-id-code {
    opacity: 0.72;
}
.member-balance {
    min-width: 80px;
    padding: 8px 18px;
    border: 2px solid #d97755;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}
.member-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.member-actions .icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.member-actions .icon-btn:hover {
    background: rgba(217, 119, 85, 0.2);
    color: #fff;
}
@media (max-width: 640px) {
    .member-row {
        padding: 8px 10px 8px 8px;
        gap: 10px;
        border-radius: 16px;
    }
    .member-id {
        display: none;
    }
    .member-balance {
        min-width: 60px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ========== MEMBER DETAIL MODAL ========== */
.member-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: memberModalFadeIn 0.15s ease;
}
@keyframes memberModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.member-modal {
    position: relative;
    background: #1f2127;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px 28px 24px;
    width: 100%;
    max-width: 640px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    color: #e5e7eb;
}
.member-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.member-modal-close:hover {
    background: rgba(255, 77, 109, 0.2);
}
.member-detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.member-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d97755;
    background: #2b2d35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.member-detail-id {
    flex: 1;
    min-width: 0;
}
.member-detail-id h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    word-break: break-word;
}
.member-detail-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.member-detail-meta code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.member-detail-balance {
    padding: 10px 20px;
    border: 2px solid #d97755;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}
.member-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.member-detail-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
}
.member-detail-stat .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.member-detail-stat .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.member-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.member-detail-section-title {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}
.member-detail-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}
.member-detail-empty {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
}
.inv-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    padding: 10px 8px 8px;
    background: #1c1e26;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    min-width: 0;
}
.inv-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(217, 119, 85, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}
.inv-item.has-img .inv-icon {
    background: #0f1218;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.inv-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.inv-emoji {
    line-height: 1;
}
.inv-name {
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    line-height: 1.25;
    width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.inv-price {
    color: #fbbf24;
    font-weight: 700;
    font-size: 11px;
}
.inv-date {
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    line-height: 1.2;
}
.inv-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 2px;
}
.inv-status.status-active,
.inv-status.status-delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.inv-status.status-expired {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.inv-status.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.inv-status.status-default {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}
@media (max-width: 540px) {
    .member-modal {
        padding: 20px 18px 18px;
        max-height: 92vh;
    }
    .member-detail-head {
        flex-wrap: wrap;
    }
    .member-detail-balance {
        order: 99;
        width: 100%;
        text-align: center;
    }
}

/* ========== IMPORT MODAL ========== */
.import-modal {
    max-width: 760px;
}
.import-modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.import-lead {
    margin: 0 0 14px;
    font-size: 13px;
}
.import-mode {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.import-mode label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #e5e7eb;
}
.import-mode input[type="radio"] {
    accent-color: #d97755;
}
#importText {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e5e7eb;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    resize: vertical;
    margin-bottom: 14px;
    outline: none;
}
#importText:focus {
    border-color: #d97755;
    background: rgba(0, 0, 0, 0.35);
}
.import-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 14px;
}
.import-result {
    margin-top: 8px;
}
.import-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 12px;
    font-size: 13px;
}
.pill.pill-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pill.pill-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.import-table-wrap {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}
.import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.import-table th,
.import-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.import-table th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}
.import-row-name {
    font-weight: 600;
    color: #fff;
}
.import-row-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}
.import-row-meta code {
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}
.import-unmatched {
    margin-top: 14px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 10px;
    padding: 10px 14px;
}
.import-unmatched summary {
    cursor: pointer;
    font-size: 13px;
    color: #fbbf24;
}
.import-unmatched ul {
    margin: 8px 0 4px 18px;
    padding: 0;
    font-size: 12px;
    color: #e5e7eb;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--tardis-blue-bright);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.link-btn:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* ========== DATA TABLES ========== */
.data-table {
    display: flex;
    flex-direction: column;
}

.data-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.data-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-row:last-child {
    border-bottom: none;
}

.row-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-darker);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

.row-icon-rank {
    background: linear-gradient(135deg, var(--tardis-blue-bright), var(--discord-blurple));
    color: white;
    font-weight: 800;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
}

.row-info {
    flex: 1;
    min-width: 0;
}

.row-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.row-meta code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-darker);
    padding: 1px 6px;
    border-radius: 4px;
}

.row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.row-tag {
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 999px;
    color: var(--tardis-blue-bright);
    font-size: 11px;
    font-weight: 500;
}

.row-price {
    color: var(--gold);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

/* ========== PURCHASES (historique ventes) ========== */
.data-row--purchase {
    gap: 10px;
    padding: 8px 14px;
    align-items: center;
}

.data-row--purchase-compact {
    padding: 7px 12px;
}

.row-icon--item img {
    object-fit: cover;
}

.row-icon--emoji {
    font-size: 20px;
}

.row-title--purchase {
    margin-bottom: 1px;
    gap: 10px;
    justify-content: space-between;
}

.row-title-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.row-meta--purchase {
    gap: 6px;
    font-size: 11px;
}

.row-meta-dot {
    color: var(--text-muted);
    opacity: 0.55;
    user-select: none;
}

.row-meta-date {
    white-space: nowrap;
}

.purchase-buyer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: min(220px, 42vw);
}

.purchase-buyer-avatar,
.purchase-buyer-fallback {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.purchase-buyer-avatar {
    object-fit: cover;
}

.purchase-buyer-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    background: var(--discord-blurple);
    color: #fff;
}

.purchase-buyer-name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-buyer-handle {
    color: var(--text-muted);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.purchase-status.status-delivered,
.purchase-status.status-active {
    color: #6ee7a8;
    background: rgba(37, 230, 166, 0.12);
    border-color: rgba(37, 230, 166, 0.28);
}

.purchase-status.status-pending {
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.12);
    border-color: rgba(252, 211, 77, 0.28);
}

.purchase-status.status-expired,
.purchase-status.status-failed {
    color: #ff8fa3;
    background: rgba(255, 77, 109, 0.12);
    border-color: rgba(255, 77, 109, 0.28);
}

@media (max-width: 640px) {
    .purchase-buyer-handle { display: none; }
    .row-title--purchase .row-price { font-size: 12px; }
}

/* ========== ADMIN FILTER BAR ========== */
.admin-filter-bar {
    margin-bottom: 16px;
    padding: 0 !important;
}

.items-cat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(12, 16, 36, 0.55);
}

.items-cat-create {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.items-cat-create .form-field {
    margin: 0;
    min-width: 180px;
}

.btn-danger {
    background: rgba(255, 77, 109, 0.16);
    color: #ff8fa3;
    border: 1px solid rgba(255, 77, 109, 0.35);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 77, 109, 0.28);
}

.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.items-cat-openbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    min-height: 28px;
}

.items-cat-openbar h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.items-cat-openbar .btn {
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.admin-cat-landing {
    margin-bottom: 8px;
}

/* Tuiles plus basses pour que les catégories tiennent dans la fenêtre du panel. */
.admin-cat-landing.category-landing {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.admin-cat-landing .category-tile {
    min-height: 0;
}
.admin-cat-landing .category-tile-preview {
    flex: 0 0 78px;
    min-height: 78px;
}
.admin-cat-landing .category-tile-body {
    padding: 10px 12px;
}
.admin-cat-landing .category-tile-name {
    font-size: 15px;
    margin-bottom: 2px;
}
.admin-cat-landing .category-tile-count {
    font-size: 12px;
}
.items-cat-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.items-cat-create {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.items-cat-create .form-field {
    margin: 0;
    min-width: 0;
}

.items-cat-create .field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.items-cat-create input {
    height: 28px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.items-cat-toolbar .btn {
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.admin-cat-landing .empty {
    grid-column: 1 / -1;
}

/* ========== INLINE FORM (économie) ========== */
.inline-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.inline-form .form-field {
    margin: 0;
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 14px;
}

/* ========== EMPTY / LOADING ========== */
.loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty h4 {
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

/* ========== MODAL OVERRIDE ========== */
.admin-body .modal-overlay {
    align-items: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* ===== Modal dans l'iframe du panel (embed) =====
   Dans l'iframe, l'unité « vh » n'est pas fiable : le max-height en 100vh du
   modal ne borne pas sa hauteur, donc le défilement interne ne s'enclenche
   jamais (champs du bas inatteignables, étiquettes qui se chevauchent).
   On neutralise ce max-height et on fait défiler l'overlay lui-même, qui est
   calé sur la taille réelle de l'iframe (position:fixed; inset:0). */
body.embed-mode .modal-overlay {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Moins de marge latérale/verticale : le modal prend plus de largeur
       (gauche/droite) et gagne donc en hauteur utile → moins long. */
    padding: 16px 12px;
}
body.embed-mode .modal-editor {
    max-height: none;
    overflow: visible;
    /* Élargit le modal pour exploiter toute la largeur de l'iframe. */
    max-width: 100%;
    width: 100%;
}
body.embed-mode .editor-layout {
    overflow: visible;
    min-height: 0;
}
body.embed-mode .editor-form {
    overflow: visible;
}
/* Quand il y a la place (iframe large), aperçu un peu plus large : le contenu
   s'étale horizontalement, donc le formulaire est moins haut. */
@media (min-width: 901px) {
    body.embed-mode .editor-layout {
        grid-template-columns: 1fr 380px;
    }
}

/* ============================================
   ITEM EDITOR — Nouveau design
   ============================================ */
.modal-editor {
    max-width: 1080px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.modal-editor .modal-header {
    flex-shrink: 0;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.editor-form {
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.editor-form::-webkit-scrollbar { width: 8px; }
.editor-form::-webkit-scrollbar-track { background: transparent; }
.editor-form::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.editor-form::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* === SECTIONS === */
.form-section {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.form-section:hover {
    border-color: rgba(96, 165, 250, 0.25);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.section-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.35);
}

.section-head h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.section-head p {
    font-size: 12px;
    color: var(--text-muted);
}

.section-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* === FIELDS === */
.field-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    gap: 12px;
}

.field-label em {
    color: var(--danger);
    font-style: normal;
    margin-left: 2px;
}

.field-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
    font-style: italic;
}

.char-counter {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.char-counter.warn { color: var(--gold); }
.char-counter.danger { color: var(--danger); }

.form-section .form-field {
    margin: 0;
}

.form-section input[type="text"],
.form-section input[type="number"],
.form-section select,
.form-section textarea {
    background: var(--bg-darker);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.15s;
    width: 100%;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
    outline: none;
    border-color: var(--tardis-blue-bright);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    background: var(--bg-dark);
}

.form-section textarea {
    resize: vertical;
    min-height: 76px;
    line-height: 1.5;
}

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

/* === INPUT WITH PREFIX/SUFFIX === */
.input-with-prefix,
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-prefix,
.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border);
}

.input-with-prefix .input-prefix {
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.input-with-prefix input {
    border-radius: 0 10px 10px 0 !important;
    flex: 1;
}

.input-with-suffix .input-suffix {
    border-left: none;
    border-radius: 0 10px 10px 0;
}

.input-with-suffix input {
    border-radius: 10px 0 0 10px !important;
    flex: 1;
}

.input-with-prefix:focus-within .input-prefix,
.input-with-suffix:focus-within .input-suffix {
    border-color: var(--tardis-blue-bright);
}

/* === EMOJI PICKER === */
.emoji-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emoji-picker input {
    font-size: 18px !important;
    text-align: center;
    letter-spacing: 4px;
}

.emoji-suggestions {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.emoji-suggestions button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.1s;
    line-height: 1;
}

.emoji-suggestions button:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.2);
}

.emoji-suggestions button.active {
    background: var(--gradient-primary);
    transform: scale(1.1);
}

/* === CHIP PICKER (catégories existantes) === */
.chip-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.chip:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.chip.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* === BADGE PICKER === */
.badge-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.badge-option {
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.badge-option:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.badge-option.active {
    border-color: var(--tardis-blue-bright);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.badge-preview {
    pointer-events: none;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
}

.badge-none {
    color: var(--text-muted);
}

/* === DELIVERY PICKER (cartes) === */
.delivery-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.delivery-option {
    cursor: pointer;
    display: block;
}

.delivery-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.delivery-card {
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.15s;
    height: 100%;
}

.delivery-option:hover .delivery-card {
    border-color: var(--border-hover);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.delivery-option input:checked + .delivery-card {
    border-color: var(--tardis-blue-bright);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), transparent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.delivery-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.delivery-icon-blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--tardis-blue-bright);
}

.delivery-icon-gold {
    background: rgba(255, 215, 0, 0.12);
    color: var(--gold);
}

.delivery-option input:checked + .delivery-card .delivery-icon {
    transform: scale(1.1);
}

.delivery-card strong {
    font-size: 13px;
    font-weight: 700;
}

.delivery-card span {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* === CHAMPS CONDITIONNELS === */
.conditional-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px dashed rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === DURATION PRESETS === */
.duration-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.preset-btn {
    background: var(--bg-darker);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 9px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.preset-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.preset-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* ============================================
   COLONNE DROITE : aperçu
   ============================================ */
.editor-preview {
    background: var(--bg-darker);
    border-left: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
}

.preview-sticky {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--tardis-blue-bright);
    margin-bottom: 4px;
}

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-card);
}

/* Réutilisation du style des cards de la boutique */
.preview-card .shop-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-card .pc-image {
    height: 140px;
    background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.preview-card .pc-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.18), transparent 70%);
}

.preview-card .pc-image span {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.preview-card .pc-image.has-img {
    background: #0b1224;
}

.preview-card .pc-image.has-img::before {
    display: none;
}

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

.preview-card .pc-body {
    padding: 16px;
}

.preview-card .pc-cat {
    font-size: 11px;
    font-weight: 600;
    color: var(--tardis-blue-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.preview-card .pc-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.preview-card .pc-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
    min-height: 36px;
}

.preview-card .pc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-card .pc-price {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
    font-size: 16px;
    color: var(--gold);
}

.preview-card .pc-old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
}

.preview-card .pc-buy {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    font-family: inherit;
    cursor: not-allowed;
    opacity: 0.85;
}

.preview-card.is-empty .pc-image {
    color: var(--text-muted);
    font-size: 48px;
}

.preview-card.is-empty .pc-name {
    color: var(--text-muted);
    font-style: italic;
}

/* Bloc d'infos sous l'aperçu */
.preview-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.preview-info-row span {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-size: 10px;
}

.preview-info-row code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-darker);
    padding: 2px 8px;
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 11px;
}

.preview-info-row strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
}

/* ============================================
   FOOTER ACTIONS
   ============================================ */
.modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
}

/* === Responsive éditeur === */
@media (max-width: 900px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .editor-preview {
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .preview-sticky {
        position: static;
    }
    .delivery-picker {
        grid-template-columns: 1fr;
    }
    .badge-picker {
        grid-template-columns: repeat(2, 1fr);
    }
    .emoji-suggestions {
        grid-template-columns: repeat(6, 1fr);
    }
    .duration-presets {
        grid-template-columns: repeat(3, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }
}

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

    .admin-sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 12px;
    }

    .sidebar-brand {
        border-bottom: none;
        padding: 4px 8px;
        flex: 0 0 auto;
    }

    .sidebar-nav {
        flex-direction: row;
        flex: 1;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
    }

    .sidebar-nav .nav-item {
        white-space: nowrap;
        padding: 8px 12px;
    }

    .nav-item.active::before {
        display: none;
    }

    .sidebar-footer {
        flex: 0 0 100%;
        flex-direction: row;
        align-items: center;
        padding-top: 12px;
    }

    .sidebar-user {
        flex: 1;
    }

    .admin-main {
        padding: 20px;
    }

    .view-header h1 {
        font-size: 20px;
    }

    .stat-card-value {
        font-size: 20px;
    }
}

/* ============================================
   VUE GAINS — Configuration des sources de gain
   ============================================ */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}
body.embed-mode .header-actions {
    gap: 8px;
    flex-wrap: nowrap;
}

.earnings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 0;
}

.earnings-legend {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted, #64748b);
    font-size: 11px;
    line-height: 1.3;
}

.earnings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.earnings-group-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.earnings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.earning-card {
    --c: #5865f2;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: inset 3px 0 0 0 var(--c);
}

.earning-card:hover {
    border-color: color-mix(in srgb, var(--c) 45%, var(--border));
    box-shadow:
        inset 3px 0 0 0 var(--c),
        0 10px 28px rgba(0, 0, 0, 0.18);
}

.earning-card.is-disabled {
    opacity: 0.72;
    filter: grayscale(0.35);
    box-shadow: inset 3px 0 0 0 rgba(148, 163, 184, 0.45);
}

.earning-card.is-disabled .earning-body {
    pointer-events: none;
}

.earning-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--c) 10%, transparent),
        rgba(15, 23, 42, 0.35)
    );
}

.earning-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--c) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    color: var(--c);
    display: flex;
    align-items: center;
    justify-content: center;
}

.earning-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.earning-title {
    flex: 1;
    min-width: 0;
}

.earning-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.earning-title h3 {
    font-size: 14px;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.earning-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.earning-badge.is-on {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.earning-badge.is-off {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.28);
}

.earning-title p {
    font-size: 11px;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.earning-title code,
.earning-note code {
    background: rgba(96, 165, 250, 0.12);
    color: var(--tardis-blue-bright);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.earning-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.earning-body .form-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(168px, 46%);
    align-items: center;
    gap: 10px;
}

.earning-body .field-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    min-width: 0;
}

.earning-body .field-hint {
    font-size: 10px;
    font-weight: 400;
    font-style: normal;
    color: var(--text-muted, #64748b);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.earning-note {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted, #64748b);
    line-height: 1.3;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    transition: background 0.2s;
}

.toggle-track::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-track {
    background: var(--tardis-blue-bright);
}

.toggle-switch input:checked + .toggle-track::before {
    transform: translateX(18px);
}

/* ============================================
   AVAILABILITY TOGGLE (éditeur d'item)
   ============================================ */
.availability-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.18);
    cursor: pointer;
    margin-bottom: 18px;
    transition: background 0.2s, border-color 0.2s;
}

.availability-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

.availability-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.availability-toggle .toggle-track {
    position: relative;
    inset: auto;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    background: rgba(148, 163, 184, 0.3);
}

.availability-toggle input:checked ~ .toggle-track {
    background: var(--tardis-blue-bright, #3b82f6);
}

.availability-toggle input:checked ~ .toggle-track::before {
    transform: translateX(18px);
}

.availability-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.availability-text strong {
    font-size: 14px;
    color: var(--text-primary, #fff);
}

.availability-text span {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

/* Badge "Bientôt" en table admin */
.badge-soon {
    background: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Lignes d'items désactivés dans la table admin */
.data-row.is-unavailable {
    opacity: 0.65;
}

.data-row.is-unavailable .row-icon {
    filter: grayscale(0.4);
}

/* Aperçu (modal éditeur) en mode désactivé */
.preview-card.is-unavailable {
    opacity: 0.75;
    filter: grayscale(0.3);
}

/* Input suffix (number + unit) */
.earning-body .input-suffix {
    border-radius: 8px;
    height: 34px;
    width: 100%;
    min-width: 0;
}

.input-suffix {
    display: flex;
    align-items: stretch;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-suffix:focus-within {
    border-color: var(--tardis-blue-bright);
}

.earning-body .input-suffix input {
    flex: 1 1 4.2em;
    min-width: 4.2em;
    width: 4.2em;
    padding: 0 8px;
    font-size: 14px;
    height: 32px;
    text-align: right;
}

.input-suffix input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-variant-numeric: tabular-nums;
}

.input-suffix input::-webkit-outer-spin-button,
.input-suffix input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-suffix span {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 8px;
    background: rgba(15, 23, 42, 0.6);
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0;
    white-space: nowrap;
}

/* Quick preset chips */
.quick-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.quick-presets > span {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 4px;
}

.quick-presets .chip {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: var(--tardis-blue-bright);
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.quick-presets .chip:hover {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.5);
}

/* Status banner */
.earnings-status {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.25s ease;
}

.earnings-status.is-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.earnings-status.is-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.earnings-status.is-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.35);
    color: var(--tardis-blue-bright);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   IMAGE UPLOADER (éditeur d'item)
   ============================================ */
.image-uploader {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.image-preview {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--bg-dark);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    padding: 6px;
}

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

.image-placeholder {
    line-height: 1.3;
    opacity: 0.7;
}

.image-actions {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.image-actions .btn-ghost {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.image-actions .btn-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
}

.image-upload-status {
    flex-basis: 100%;
    font-size: 12px;
    margin-top: 2px;
    color: var(--text-muted);
    min-height: 16px;
}

.image-upload-status.is-success { color: #34d399; }
.image-upload-status.is-error   { color: #f87171; }
.image-upload-status.is-info    { color: var(--tardis-blue-bright); }

/* ============================================
   EMBED MODE — panel admin du Shop intégré dans le panel du bot
   ============================================ */
html.embed-mode,
body.embed-mode.admin-body {
    background: #0a0e1a !important;
    overflow: hidden !important;
    min-height: 0;
    height: auto;
    color: #e5e7eb;
}

/* Embed dans la boutique : scroll vertical libre sur tout le contenu admin */
html.embed-mode.embed-scroll,
body.embed-mode.embed-scroll.admin-body {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
body.embed-mode.embed-scroll .admin-layout {
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden;
}
body.embed-mode.embed-scroll .admin-main {
    height: 100% !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
body.embed-mode.embed-scroll .admin-main::-webkit-scrollbar {
    width: 8px !important;
    height: 0 !important;
    display: block !important;
}
body.embed-mode.embed-scroll .admin-main::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 8px;
}

body.embed-mode .stars,
body.embed-mode .stars-2,
body.embed-mode .stars-3 {
    display: none !important;
}

body.embed-mode .admin-sidebar {
    display: none !important;
}

.embed-panel-brand{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 14px;
    padding: 6px 4px 10px;
    border: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.14);
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: opacity 0.15s ease;
}
.embed-panel-brand:hover{
    opacity: 0.88;
}
.embed-panel-brand-icon{
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}
.embed-panel-brand-text{
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-family: Orbitron, Inter, system-ui, sans-serif;
}
.embed-panel-brand .logo-accent{
    color: #5ec8ff;
}

body.embed-mode .admin-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    background: #0a0e1a;
    overflow: visible;
}

body.embed-mode .admin-main {
    padding: 8px 14px 16px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
    background: #0a0e1a;
}

body.embed-mode .view-header {
    margin: 0 0 10px;
    min-height: 28px;
    gap: 8px 12px;
    flex-wrap: nowrap;
    align-items: center;
    padding-right: 176px;
}
body.embed-mode .view-header > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}
body.embed-mode .view-header h1 {
    color: #fff;
    font-size: 16px;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
}
body.embed-mode .view-subtitle {
    color: rgba(226, 232, 240, 0.62);
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.embed-mode .view-header .btn {
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

body.embed-mode .stat-card,
body.embed-mode .earning-card,
body.embed-mode .panel,
body.embed-mode .filter-bar,
body.embed-mode .data-table {
    background-color: #131826;
    border-color: rgba(96, 165, 250, 0.12);
}

body.embed-mode .stat-card {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
body.embed-mode .earning-card {
    box-shadow: inset 3px 0 0 0 var(--c);
}

/* Pas de barre de scroll horizontale (le « pilule » en bas). */
body.embed-mode,
body.embed-mode .admin-layout,
body.embed-mode .admin-main,
body.embed-mode .admin-view,
body.embed-mode .panel,
body.embed-mode .filter-bar,
body.embed-mode .data-table {
    scrollbar-width: none;
}
body.embed-mode::-webkit-scrollbar,
body.embed-mode *::-webkit-scrollbar {
    height: 0 !important;
    width: 0 !important;
    display: none !important;
}

body.embed-mode .view-header {
    margin: 0 0 8px;
}

body.embed-mode .admin-loader,
body.embed-mode .admin-denied {
    background: #0a0e1a;
}

body.embed-mode .denied-card {
    background: rgba(20, 24, 38, 0.95);
}

body.embed-mode .earning-card { background-color: #131826; }

body.embed-mode input,
body.embed-mode select,
body.embed-mode textarea {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Embed panel — contenu mobile (tableaux, header, formulaires) */
@media (max-width: 720px) {
    body.embed-mode .admin-main {
        padding: 12px 10px 24px;
        overflow-x: hidden;
        max-width: 100%;
    }
    body.embed-mode .view-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 8px;
        padding-right: 150px;
    }
    body.embed-mode .view-header > div:first-child {
        flex-direction: row;
        align-items: baseline;
    }
    body.embed-mode .header-actions {
        width: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
    }
    body.embed-mode .header-actions .btn,
    body.embed-mode .header-actions button {
        width: auto;
        justify-content: center;
    }
    body.embed-mode .stat-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }
    body.embed-mode .data-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    body.embed-mode .data-row {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 10px;
    }
    body.embed-mode .row-info {
        flex: 1 1 100%;
        min-width: 0;
    }
    body.embed-mode .row-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: stretch;
    }
    body.embed-mode .row-actions .btn,
    body.embed-mode .row-actions button {
        flex: 1 1 auto;
    }
    body.embed-mode .inline-form {
        grid-template-columns: 1fr;
    }
    body.embed-mode input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body.embed-mode select,
    body.embed-mode textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    body.embed-mode .editor-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    body.embed-mode .modal-editor {
        max-width: 100%;
        max-height: calc(100vh - 16px);
    }
}
