/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding-top: 60px;
}

/* Barre de recherche globale fixe */
.global-search-bar {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 10px 20px;
}

.global-search-form {
    display: flex;
    gap: 10px;
    max-width: 800px;
}

.global-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.global-search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.global-search-btn {
    padding: 10px 25px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.global-search-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.search-autocomplete {
    position: absolute;
    top: 50px;
    left: 20px;
    right: 20px;
    max-width: 780px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #2c3e50;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.ac-icon {
    font-size: 20px;
    margin-right: 10px;
}

.ac-text {
    flex: 1;
    font-size: 14px;
}

/* Page de connexion */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-weight: normal;
}

.error-message {
    background: #f44336;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.login-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.login-info p {
    margin: 5px 0;
}

/* Layout principal */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    font-size: 1.8em;
    color: #ecf0f1;
}

.logo p {
    color: #95a5a6;
    margin-top: 5px;
}

.menu {
    list-style: none;
}

.menu li {
    margin-bottom: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item .icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.user-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info p {
    margin: 5px 0;
}

.user-info .role {
    color: #95a5a6;
    font-size: 0.9em;
}

.btn-logout {
    display: block;
    margin-top: 10px;
    padding: 8px;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #e74c3c;
}

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

/* En-tête de page */
.page-header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 5px;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.btn-back {
    display: inline-block;
    padding: 8px 15px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 15px;
}

.btn-back:hover {
    background: #7f8c8d;
}

/* Cartes de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: normal;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

/* Graphiques */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Top joueurs */
.top-players {
    max-height: 400px;
    overflow-y: auto;
}

.player-rank {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.player-rank:last-child {
    border-bottom: none;
}

.player-rank .rank {
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
}

.player-rank .name {
    flex: 1;
}

.player-rank .money {
    font-weight: bold;
    color: #27ae60;
}

/* Tableaux */
.table-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.sort-link {
    color: #2c3e50;
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s;
}

.sort-link:hover {
    color: #667eea;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-lombrasier {
    background: #c41e3a;
    color: white;
}

.badge-vervenin {
    background: #1a472a;
    color: white;
}

.badge-rongebois {
    background: #ecb939;
    color: #333;
}

.badge-serdental {
    background: #2a623d;
    color: white;
}

.badge-briselune {
    background: #5dade2;
    color: white;
}

.badge-autre {
    background: #95a5a6;
    color: white;
}

.badge-red {
    background: #e74c3c;
    color: white;
}

/* Boutons */
.btn-small {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Actions de page */
.page-actions {
    margin-bottom: 20px;
}

.search-form {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.search-form input:focus {
    outline: none;
    border-color: #667eea;
}

.per-page-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.per-page-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.page-info {
    color: #7f8c8d;
}

.total-info {
    font-size: 0.9em;
    color: #95a5a6;
    margin-left: 5px;
}

/* Activité récente */
.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Profil joueur */
.player-profile {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-text {
    color: white;
    font-size: 2.5em;
    font-weight: bold;
}

.profile-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.profile-meta {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.info-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #7f8c8d;
}

.info-row .value {
    font-weight: 600;
    color: #2c3e50;
}

.info-row .money {
    color: #27ae60;
}

.info-row .money.total {
    font-size: 1.2em;
}

.no-data {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.full-width {
    grid-column: 1 / -1;
}

/* Inventaire */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.inventory-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-slot {
    font-size: 0.8em;
    color: #95a5a6;
    margin-bottom: 5px;
}

.item-image {
    width: 48px;
    height: 48px;
    margin: 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-image img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.item-placeholder {
    font-size: 2em;
}

.item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
    font-size: 0.85em;
}

.item-count {
    color: #27ae60;
    font-size: 0.9em;
    font-weight: 600;
}

/* Grille économie */
.economy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-mini {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.stat-mini {
    display: inline-block;
    margin-right: 30px;
}

.stat-label {
    color: #7f8c8d;
    margin-right: 10px;
}

.stat-mini .stat-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.2em;
}

.money-positive {
    color: #27ae60;
    font-weight: 600;
}

.money-negative {
    color: #e74c3c;
    font-weight: 600;
}

.license {
    color: #95a5a6;
    font-size: 0.85em;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .user-info {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
    }
    
    .stats-grid,
    .charts-grid,
    .profile-grid,
    .economy-grid {
        grid-template-columns: 1fr;
    }
}

