/* Admin Panel Styles */

.admin-header {
    background: linear-gradient(135deg, oklch(25% .08 260) 0%, oklch(20% .06 260) 100%);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 20px;
    margin: 20px;
    text-align: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
}

.admin-header p {
    font-size: 13px;
    color: var(--muted-foreground);
}

.stats-filters {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--foreground);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border-radius: calc(var(--radius));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
}

.stat-label {
    font-size: 11px;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--foreground);
}

.stat-change {
    font-size: 11px;
    margin-top: 4px;
}

.stat-change.positive {
    color: oklch(70% .15 150);
}

.stat-change.negative {
    color: oklch(70% .15 20);
}

.section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 20px;
    margin: 0 20px 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    font-weight: 600;
    font-size: 14px;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 2px;
}

.user-details p {
    font-size: 11px;
    color: var(--muted-foreground);
}

.user-balance {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.chart-container {
    width: 100%;
    height: 200px;
    background: var(--secondary);
    border-radius: calc(var(--radius));
    padding: 16px;
    margin-top: 12px;
}

/* User Filters */
.user-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.user-filter-btn {
    padding: 6px 12px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--foreground);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.user-filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* User List Full */
.user-list-full {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.user-card-full {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card-full:hover {
    background: var(--accent);
    border-color: var(--primary);
}

.user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-status.online {
    background: oklch(70% .15 150);
    box-shadow: 0 0 8px oklch(70% .15 150);
}

.user-status.offline {
    background: oklch(40% .008 260);
}

.user-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

.user-card-balance {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.user-card-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--muted-foreground);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    border-radius: calc(var(--radius));
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--foreground);
}

.modal-body {
    padding: 20px;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 10px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    font-size: 13px;
    color: var(--foreground);
    font-family: inherit;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent);
}

.btn-primary {
    padding: 10px 16px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: calc(var(--radius));
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 8px 14px;
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--accent);
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Onglets Admin */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.admin-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: var(--foreground);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Contenu des onglets */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cibles d'annonces */
.announcement-targets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.target-btn {
    padding: 10px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    color: var(--foreground);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.target-btn:hover {
    background: var(--accent);
}

.target-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.announcement-preview {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 12px;
}

@media (min-width: 480px) {
    .announcement-targets {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Navigation entre pages admin */
.admin-nav-links {
    display: flex;
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.nav-link {
    padding: 10px 16px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    color: var(--foreground);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--accent);
}

.nav-link.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}
/* ── Recherche utilisateurs ── */
.user-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 10px 14px;
    margin-bottom: 12px;
}
.user-search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--foreground);
    font-size: 14px;
    flex: 1;
    font-family: inherit;
}
.user-search-input::placeholder { color: var(--muted-foreground); }

/* ── Badge ban ── */
.badge-banned {
    background: rgba(220,50,50,0.15);
    color: #ff5555;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}
.badge-admin {
    background: rgba(255,180,0,0.15);
    color: #ffb800;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* ── Modal tabs ── */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--secondary);
    padding: 6px 8px;
    gap: 4px;
}
.modal-tab {
    flex: 1;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 500;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.modal-tab.active {
    background: var(--card);
    color: var(--foreground);
    font-weight: 600;
}
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ── Card item dans modal ── */
.card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
}
.card-item-name { font-weight: 600; }
.card-item-code { font-size: 11px; color: var(--muted-foreground); font-family: monospace; }
.btn-danger {
    background: rgba(220,50,50,0.15);
    color: #ff5555;
    border: 1px solid rgba(220,50,50,0.3);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: rgba(220,50,50,0.3); }
