* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, 'Traditional Arabic', Arial, sans-serif; background: #f0f2f5; color: #333; }

.navbar { background: linear-gradient(135deg, #1a5276, #2c3e50); color: #fff; padding: 0.8rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 1rem; }
.nav-brand { color: #fff; text-decoration: none; font-size: 1.2rem; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.nav-brand .logo-text { background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; }
.nav-menu { list-style: none; display: flex; gap: 1rem; }
.nav-menu a { color: #ecf0f1; text-decoration: none; padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.9rem; transition: background 0.2s; }
.nav-menu a:hover { background: rgba(255,255,255,0.12); color: #fff; }

.page-header {
    background: linear-gradient(135deg, #1a5276 0%, #2e86c1 50%, #3498db 100%);
    color: #fff; padding: 1rem 0 0.8rem; text-align: center;
    position: relative; overflow: hidden;
}
.page-header::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
}
.page-header .container { position: relative; }

.page-header p { margin: 0.3rem 0 0; opacity: 0.9; font-size: 1rem; }

.container { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }

h2 { margin-bottom: 1rem; color: #1a5276; font-size: 1.4rem; position: relative; padding-bottom: 0.5rem; }
h2::after { content: ''; position: absolute; bottom: 0; right: 0; width: 50px; height: 3px; background: linear-gradient(90deg, #2e86c1, transparent); border-radius: 2px; }
h3 { margin: 1.5rem 0 0.8rem; color: #2c3e50; }

.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid rgba(0,0,0,0.04); }

.stats { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.stat-card {
    background: #fff; padding: 1.5rem; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex: 1; min-width: 140px;
    text-align: center; font-size: 1rem; transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.stat-card strong { font-size: 2rem; display: block; color: #1a5276; }
.stat-card .stat-icon { font-size: 2rem; margin-bottom: 0.3rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 1.5rem; }
th, td { text-align: right; padding: 0.75rem 1rem; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; color: #1a5276; font-weight: 600; font-size: 0.9rem; }
td { font-size: 0.9rem; }
tr:hover { background: #f1f5f9; }
tr:last-child td { border-bottom: none; }

.rang-1 { background: #fff9e6; }
.rang-2 { background: #f0f7ff; }
.rang-3 { background: #fef0f0; }

.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.badge-or { background: #f1c40f; color: #fff; }
.badge-argent { background: #bdc3c7; color: #fff; }
.badge-bronze { background: #e67e22; color: #fff; }

.btn, button[type="submit"] {
    display: inline-block; padding: 0.6rem 1.2rem; background: #3498db; color: #fff;
    border: none; border-radius: 8px; text-decoration: none; font-size: 0.9rem; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: #2980b9; }
.btn:active { transform: scale(0.97); }
.btn-small { display: inline-block; padding: 0.35rem 0.8rem; background: #3498db; color: #fff; border-radius: 6px; text-decoration: none; font-size: 0.8rem; margin-left: 0.3rem; transition: background 0.2s; }
.btn-small:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; }
.btn-success:hover { background: #219150; }

form { background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); max-width: 600px; margin-bottom: 1.5rem; border: 1px solid rgba(0,0,0,0.04); }
form label { display: block; margin: 0.8rem 0 0.3rem; font-weight: 600; color: #555; }
form input, form textarea, form select { width: 100%; padding: 0.6rem; border: 1px solid #ddd; border-radius: 6px; font-size: 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; }
form input:focus, form textarea:focus, form select:focus { border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52,152,219,0.15); }
form textarea { min-height: 100px; }
form button { margin-top: 1rem; }

.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.erreur { color: #e74c3c; margin: 1rem 0; font-weight: 600; padding: 0.8rem; background: #fdf0ef; border-radius: 6px; border-right: 4px solid #e74c3c; }
.succes { color: #27ae60; margin: 1rem 0; font-weight: 600; }
hr { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }
.info { background: #d9edf7; color: #31708f; padding: 1rem; border-radius: 6px; margin: 1rem 0; }
.medaille { font-size: 1.5rem; }

.footer { background: #2c3e50; color: #bdc3c7; text-align: center; padding: 1.5rem 0; font-size: 0.85rem; margin-top: 2rem; }

.filter-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: nowrap; background: #fff; padding: 0.7rem 1rem; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.04); overflow-x: auto; }
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="date"] {
    padding: 0.4rem 0.5rem; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 0.8rem;
    background: #fafbfc; min-width: auto; width: auto; transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-bar select:focus, .filter-bar input:focus {
    border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52,152,219,0.12); background: #fff;
}
.filter-bar label { font-weight: 600; color: #34495e; font-size: 0.8rem; white-space: nowrap; margin: 0; }
.filter-bar .btn-small { flex-shrink: 0; }
.print-header { display: none; text-align: center; margin-bottom: 1.5rem; }
.print-header h1 { font-size: 1.5rem; color: #1a5276; margin-bottom: 0.2rem; }
.print-header p { color: #555; }

@media (max-width: 768px) {
    .nav-menu { gap: 0.5rem; flex-wrap: wrap; }
    .nav-menu a { font-size: 0.8rem; padding: 0.3rem 0.5rem; }
    .stats { flex-direction: column; }
    .stat-card { min-width: auto; }
    .header-logo { flex-direction: column; gap: 10px; }
    .header-logo h1 { font-size: 1.3rem; }
}

@media print {
    .navbar, .page-header, .filter-bar, .print-btn, .btn, button { display: none !important; }
    .print-header { display: block !important; }
    .container { margin: 0; }
    table { font-size: 0.85rem; }
    th, td { padding: 0.4rem 0.5rem; }
    .rang-1, .rang-2, .rang-3 { background: none !important; }
}
