/**
 * Styles Administration - Vocabulaire
 */

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light, #666);
    font-size: 1.1rem;
}

/* Access denied */
.access-denied {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 2rem auto;
}

.access-denied h2 {
    color: #c62828;
    margin-bottom: 1rem;
}

.access-denied p {
    margin-bottom: 1.5rem;
    color: var(--text-light, #666);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary, #4a7c59);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light, #666);
    margin-top: 0.5rem;
}

/* Admin cards */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text, #333);
    transition: all 0.2s;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.admin-card-icon {
    font-size: 3.5rem;
    flex-shrink: 0;
}

.admin-card-content h3 {
    color: var(--primary, #4a7c59);
    margin-bottom: 0.5rem;
}

.admin-card-content p {
    font-size: 0.9rem;
    color: var(--text-light, #666);
}

.admin-card-badge {
    display: inline-block;
    background: #c62828;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
}

.admin-card-badge:empty {
    display: none;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    color: var(--primary, #4a7c59);
    font-size: 1.5rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--text-light, #666);
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Words table */
.words-table {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.words-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Column widths */
.words-table th:nth-child(1),
.words-table td:nth-child(1) { width: 20%; } /* Mot */
.words-table th:nth-child(2),
.words-table td:nth-child(2) { width: 30%; } /* Définition */
.words-table th:nth-child(3),
.words-table td:nth-child(3) { width: 12%; } /* Proposé par */
.words-table th:nth-child(4),
.words-table td:nth-child(4) { width: 10%; } /* Date */
.words-table th:nth-child(5),
.words-table td:nth-child(5) { width: 10%; } /* Statut */
.words-table th:nth-child(6),
.words-table td:nth-child(6) { width: 18%; min-width: 200px; } /* Actions */

.words-table th,
.words-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border, #eee);
}

.words-table th {
    background: var(--secondary, #f5f5f5);
    font-weight: 600;
    color: var(--text, #333);
    font-size: 0.875rem;
}

.words-table tr:hover {
    background: #fafafa;
}

.words-table tr:last-child td {
    border-bottom: none;
}

/* Word cell */
.word-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.word-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--secondary, #f5f5f5);
}

.word-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.word-text {
    font-weight: 600;
    color: var(--text, #333);
}

.word-theme {
    font-size: 0.75rem;
    color: var(--text-light, #666);
    background: var(--secondary, #f0f0f0);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.word-definition {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-validated {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-validate {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-validate:hover {
    background: #c8e6c9;
}

.btn-resolve {
    background: white;
    color: #1565c0;
    border: 1px solid #1565c0 !important;
    font-weight: 600;
}

.btn-resolve:hover {
    background: #1565c0;
    color: white;
}

.btn-reject {
    background: #ffebee;
    color: #c62828;
}

.btn-reject:hover {
    background: #ffcdd2;
}

.btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-edit:hover {
    background: #bbdefb;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
}

/* Author info */
.author-info {
    font-size: 0.875rem;
    color: var(--text-light, #666);
}

.author-info a {
    color: var(--primary, #4a7c59);
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light, #666);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

/* Form rows */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.mt-05 { margin-top: 0.5rem; }

/* Media preview */
.media-preview {
    width: 100%;
    height: 80px;
    border: 1px dashed var(--border, #ddd);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    background: var(--secondary, #f5f5f5);
    overflow: hidden;
}

.media-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-preview audio {
    width: 100%;
}

.media-placeholder {
    color: var(--text-light, #999);
    font-size: 0.875rem;
}

/* Grammar section */
.grammar-section {
    margin-top: 1rem;
    border: 1px solid var(--border, #eee);
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.grammar-section summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary, #4a7c59);
    padding: 0.5rem 0;
}

.grammar-section[open] summary {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border, #eee);
}

/* Proposer info */
.proposer-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--secondary, #f5f5f5);
    border-radius: 6px;
    color: var(--text-light, #666);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    color: #e65100;
}

.alert-actions {
    margin-top: 0.75rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Label with button */
.label-with-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.label-with-button .form-label {
    margin-bottom: 0;
}

/* AI buttons */
.btn-ai {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Language select */
.select-lang {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border, #eee);
}

.modal-header h3 {
    color: var(--primary, #4a7c59);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light, #666);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border, #eee);
}

/* Form in modal */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text, #333);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary, #4a7c59);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Grammar fields grid */
.grammar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #2e7d32;
}

.toast.error {
    background: #c62828;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-admin {
    background: #e8eaf6;
    color: #3949ab;
}

.role-enseignant {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Current user row */
.current-user {
    background: #fffde7 !important;
}

.badge-self {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-light, #888);
    margin-left: 0.5rem;
}

/* User pseudo */
.user-pseudo {
    font-weight: 600;
    color: var(--text, #333);
}

.user-email {
    color: var(--primary, #4a7c59);
    text-decoration: none;
    font-size: 0.9rem;
}

.user-email:hover {
    text-decoration: underline;
}

/* Mini stats in modal */
.user-stats {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #eee);
}

.user-stats h4 {
    font-size: 0.9rem;
    color: var(--text-light, #666);
    margin-bottom: 1rem;
}

/* User words section (modal utilisateur) */
.user-words-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #eee);
}

.user-words-section h4 {
    font-size: 0.9rem;
    color: var(--text-light, #666);
    margin-bottom: 1rem;
}

.count-badge {
    background: var(--primary, #4a7c59);
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.user-words-grid {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-word-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--secondary, #f5f5f5);
    border-radius: 8px;
    font-size: 0.85rem;
}

.user-word-card img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.user-word-card .word-img-placeholder {
    width: 40px;
    height: 40px;
    background: var(--border, #ddd);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-light, #999);
    flex-shrink: 0;
}

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

.user-word-info .word-name {
    font-weight: 600;
    color: var(--text, #333);
}

.user-word-info .word-detail {
    color: var(--text-light, #888);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-word-date {
    font-size: 0.75rem;
    color: var(--text-light, #999);
    white-space: nowrap;
}

.btn-add-common {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary, #4a7c59);
    background: white;
    color: var(--primary, #4a7c59);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add-common:hover {
    background: var(--primary, #4a7c59);
    color: white;
}

.badge-common {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Form help text */
.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light, #888);
    margin-top: 0.25rem;
}

/* Filter input */
.filter-group .form-input {
    width: auto;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Count info */
.count-info {
    font-size: 0.9rem;
    color: var(--text-light, #666);
    background: var(--secondary, #f0f0f0);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
}

/* Image section */
.image-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--border, #ddd);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary, #f5f5f5);
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-placeholder {
    color: var(--text-light, #999);
    font-size: 0.9rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.url-input {
    flex: 1;
}

/* Audio section */
.audio-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.audio-option {
    padding: 0.75rem;
    background: var(--secondary, #f5f5f5);
    border-radius: 8px;
}

.recording-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-record {
    background: #e53935;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-record.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.recording-status {
    color: #e53935;
    font-size: 0.875rem;
}

.recording-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.recording-preview audio {
    flex: 1;
}

.audio-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Image modal */
.image-source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.source-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.source-tab:hover {
    background: var(--secondary, #f5f5f5);
}

.source-tab.active {
    background: var(--primary, #4a7c59);
    color: white;
    border-color: var(--primary, #4a7c59);
}

.image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border, #ddd);
    border-top-color: var(--primary, #4a7c59);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.image-option {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--border, #ddd);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.image-option:hover {
    border-color: var(--primary, #4a7c59);
}

.image-option.selected {
    border-color: var(--primary, #4a7c59);
    border-width: 3px;
}

.image-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--border, #ddd);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.image-item:hover {
    border-color: var(--primary, #4a7c59);
}

.image-item.selected {
    border-color: var(--primary, #4a7c59);
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.3);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

.image-option .check-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: var(--primary, #4a7c59);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.image-option.selected .check-icon {
    display: flex;
}

.image-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

/* Definition/Exemple generation modals */
.definition-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

.definition-result {
    margin-bottom: 1rem;
}

.definition-preview {
    background: var(--secondary, #f5f5f5);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary, #4a7c59);
    font-style: italic;
    line-height: 1.5;
}

.definition-refine {
    margin-top: 1rem;
}

.definition-refine .label-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light, #666);
    font-weight: normal;
    margin-top: 0.25rem;
}

/* Button outline */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border, #ddd);
    color: var(--text, #333);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--secondary, #f5f5f5);
}

/* Dashboard sections */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.25rem;
    color: var(--primary, #4a7c59);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border, #eee);
}

/* Stats grid variants */
.stats-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}

.stats-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}

.stat-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffb74d;
}

.stat-card.highlight .stat-value {
    color: #e65100;
}

/* Activity container */
.activity-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.activity-tabs {
    display: flex;
    border-bottom: 1px solid var(--border, #eee);
    background: var(--secondary, #f8f9fa);
}

.activity-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light, #666);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.activity-tab:hover {
    color: var(--primary, #4a7c59);
    background: white;
}

.activity-tab.active {
    color: var(--primary, #4a7c59);
    background: white;
    border-bottom-color: var(--primary, #4a7c59);
    font-weight: 600;
}

.activity-content {
    padding: 0;
}

/* Activity table */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th,
.activity-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border, #eee);
}

.activity-table th {
    background: var(--secondary, #f8f9fa);
    font-weight: 600;
    color: var(--text, #333);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-table tbody tr:hover {
    background: #f8f9fa;
}

.activity-table tbody tr:last-child td {
    border-bottom: none;
}

.activity-table .definition-cell {
    font-size: 0.85rem;
    color: var(--text-light, #666);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-table .word-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-table .word-image {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.activity-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border, #eee);
    text-align: center;
    background: var(--secondary, #f8f9fa);
}

/* Score badges */
.score-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.score-badge.good {
    background: #e8f5e9;
    color: #2e7d32;
}

.score-badge.medium {
    background: #fff3e0;
    color: #e65100;
}

.score-badge.low {
    background: #ffebee;
    color: #c62828;
}

/* Status badges for games */
.status-badge.public {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.private {
    background: #fce4ec;
    color: #c2185b;
}

/* User status badges */
.status-badge.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-blocked {
    background: #ffebee;
    color: #c62828;
}

.status-badge.status-warning {
    background: #fff3e0;
    color: #e65100;
}

/* Moderation section in modal */
.moderation-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border, #eee);
}

.moderation-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text, #333);
}

.moderation-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--secondary, #f8f9fa);
    border-radius: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.checkbox-text::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border, #ccc);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text::before {
    background: var(--primary, #4a7c59);
    border-color: var(--primary, #4a7c59);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-label small {
    margin-left: 28px;
    font-size: 0.8rem;
    color: var(--text-light, #666);
}

/* Danger section */
.danger-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ffcdd2;
}

.danger-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #c62828;
}

.danger-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-warning {
    background: #ff9800;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* User stats in modal */
.user-stats {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border, #eee);
}

.user-stats h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text, #333);
}

.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.stat-mini {
    text-align: center;
    padding: 0.6rem 0.4rem;
    background: var(--secondary, #f8f9fa);
    border-radius: 8px;
}

.stat-mini-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary, #4a7c59);
}

.stat-mini-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
}

@media (max-width: 600px) {
    .stats-mini-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Role badge user variant */
.role-badge.user {
    background: #e8f5e9;
    color: #2e7d32;
}

/* User cell (compact: pseudo + badges + email) */
.user-cell {
    min-width: 200px;
}

.user-cell-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.user-cell-main .user-pseudo {
    font-weight: 600;
    color: var(--text, #333);
}

.user-cell-email {
    font-size: 0.8rem;
    color: var(--text-light, #888);
    margin-top: 0.15rem;
}

/* Date cell */
.date-cell {
    font-size: 0.85rem;
    color: var(--text-light, #888);
    white-space: nowrap;
}

/* Loading small */
.loading-small {
    text-align: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

/* Empty message */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light, #666);
    font-style: italic;
}

/* Error text */
p.error {
    text-align: center;
    padding: 2rem;
    color: #c62828;
}

/* Button small */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .words-table {
        overflow-x: auto;
    }

    .words-table table {
        min-width: 600px;
    }

    .grammar-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-bar {
        flex-direction: column;
    }

    .stats-mini-grid {
        grid-template-columns: 1fr;
    }

    .filter-group .form-input {
        min-width: 100%;
    }

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

    .activity-tabs {
        flex-wrap: wrap;
    }

    .activity-tab {
        flex: 1;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .activity-table {
        font-size: 0.85rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Admin actions (regeneration) */
.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.admin-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.regenerate-status {
    font-size: 0.9rem;
    color: var(--text-light, #666);
}

.regenerate-status.success {
    color: #2e7d32;
}

.regenerate-status.error {
    color: #c62828;
}

.regenerate-status.progress {
    color: #1565c0;
}

/* Progress bar for regeneration */
.regenerate-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
}

.regenerate-progress-bar {
    height: 8px;
    background: var(--border, #e0e0e0);
    border-radius: 4px;
    overflow: hidden;
}

.regenerate-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.regenerate-progress-text {
    font-size: 0.85rem;
    color: var(--text-light, #666);
}

/* ============================================
   Modal activité détails (structure alternative)
   Utilise .activity-detail-modal au lieu de .modal
   pour éviter conflit avec les modals standard
   ============================================ */

.activity-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-detail-modal.hidden {
    display: none;
}

.activity-detail-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.activity-detail-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.activity-detail-modal .modal-content.modal-large {
    max-width: 800px;
}

/* Activity info section */
.activity-info-section {
    margin-bottom: 1rem;
}

.activity-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Badge variants */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-memory { background: #e3f2fd; color: #1565c0; }
.badge-qcm { background: #fff3e0; color: #e65100; }
.badge-defi { background: #e8f5e9; color: #2e7d32; }
.badge-dictee { background: #f3e5f5; color: #7b1fa2; }
.badge-quiestce { background: #fce4ec; color: #c2185b; }
.badge-loto { background: #e0f7fa; color: #00838f; }
.badge-prononciation { background: #fff8e1; color: #ff6f00; }

.badge-public { background: #e8f5e9; color: #2e7d32; }
.badge-private { background: #fce4ec; color: #c2185b; }

/* Pedagogie section */
.pedagogie-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.pedagogie-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pedagogie-content {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

.pedagogie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.pedagogie-item {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary, #4a7c59);
}

.pedagogie-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.pedagogie-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

/* Modal tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary, #4a7c59);
}

.tab-btn.active {
    color: var(--primary, #4a7c59);
    border-bottom-color: var(--primary, #4a7c59);
}

.tab-content.hidden {
    display: none;
}

/* Results mini table */
.results-table-mini {
    width: 100%;
    border-collapse: collapse;
}

.results-table-mini th,
.results-table-mini td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.results-table-mini th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.player-name {
    font-weight: 600;
    color: var(--primary, #4a7c59);
}

.score-cell {
    font-weight: 600;
}

.score-cell.excellent { color: #27ae60; }
.score-cell.good { color: #3498db; }
.score-cell.medium { color: #f39c12; }
.score-cell.low { color: #e74c3c; }

/* Recordings list */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recording-player {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
}

.recording-player h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--primary, #4a7c59);
}

.recording-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.recording-word {
    font-weight: 500;
}

.btn-play-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--primary, #4a7c59);
    background: white;
    color: var(--primary, #4a7c59);
    border-radius: 4px;
    cursor: pointer;
}

.btn-play-small:hover {
    background: var(--primary, #4a7c59);
    color: white;
}

/* No data message */
.no-data {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-style: italic;
}

/* View button */
.btn-view {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-view:hover {
    background: #c8e6c9;
}

/* ==========================================
   Réseau sémantique (admin mots communs)
   ========================================== */

.reseau-semantique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.reseau-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.reseau-field .field-help {
    font-size: 0.8rem;
    color: var(--text-light, #666);
}

.section-help {
    font-size: 0.85rem;
    color: var(--text-light, #666);
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(74, 124, 89, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--primary, #4a7c59);
}

/* Ajustement TagsInput dans admin */
.grammar-section .tags-input-wrapper {
    min-height: 38px;
    font-size: 0.9rem;
}

.grammar-section .tag-item {
    font-size: 0.85rem;
}

/* ==========================================
   Admin Séries - Tableau amélioré
   ========================================== */

.admin-series-table table {
    table-layout: auto;
}

/* Cellule série (titre + thème) */
.serie-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.serie-cell-title {
    font-weight: 600;
    color: var(--text, #333);
    font-size: 0.95rem;
}

.serie-cell-theme {
    font-size: 0.75rem;
    color: var(--text-light, #888);
    background: var(--secondary, #f0f0f0);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* Créateur */
.cell-creator {
    font-size: 0.9rem;
    color: var(--text-light, #555);
    white-space: nowrap;
}

/* Contenu (mots · jeux) */
.cell-center {
    font-size: 0.85rem;
    color: var(--text-light, #666);
    white-space: nowrap;
}

.cell-separator {
    margin: 0 0.25rem;
    color: #ccc;
}

/* Boutons icônes compacts */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    background: var(--secondary, #f0f0f0);
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-icon-success { background: #e8f5e9; }
.btn-icon-success:hover { background: #c8e6c9; }

.btn-icon-danger { background: #ffebee; }
.btn-icon-danger:hover { background: #ffcdd2; }

.btn-icon-warn { background: #fff3e0; }
.btn-icon-warn:hover { background: #ffe0b2; }

/* Tableau admin activités */
.admin-activites-table table {
    table-layout: fixed;
}

.admin-activites-table th:nth-child(1),
.admin-activites-table td:nth-child(1) { width: 22%; }  /* Activité */
.admin-activites-table th:nth-child(2),
.admin-activites-table td:nth-child(2) { width: 10%; }  /* Type */
.admin-activites-table th:nth-child(3),
.admin-activites-table td:nth-child(3) { width: 10%; }  /* Créateur */
.admin-activites-table th:nth-child(4),
.admin-activites-table td:nth-child(4) { width: 14%; }  /* Série */
.admin-activites-table th:nth-child(5),
.admin-activites-table td:nth-child(5) { width: 12%; }  /* Statut */
.admin-activites-table th:nth-child(6),
.admin-activites-table td:nth-child(6) { width: 7%; }   /* Parties */
.admin-activites-table th:nth-child(7),
.admin-activites-table td:nth-child(7) { width: 9%; }   /* Date */
.admin-activites-table th:nth-child(8),
.admin-activites-table td:nth-child(8) { width: 16%; }  /* Actions */

.admin-activites-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-activites-table td:nth-child(5) {
    white-space: normal;
}

/* Ligne signalée */
.row-reported {
    background: #fffde7 !important;
}

/* Ligne détail signalement */
.report-detail-row td {
    padding: 0 !important;
    border-bottom: 2px solid #ff9800 !important;
}

.report-detail-box {
    padding: 0.5rem 1rem;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.report-detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.85rem;
}

.report-detail-item + .report-detail-item {
    border-top: 1px solid rgba(255, 152, 0, 0.2);
}

.report-detail-motif {
    font-weight: 600;
    white-space: nowrap;
}

.report-detail-comment {
    color: #666;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-detail-date {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-mini {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.75rem !important;
}
