:root {
    --bg: #050505; 
    --card-avail: #121212; 
    --card-taken: #1c150b; 
    --card-partial: #1a233a;
    --gold: #D4AF37; 
    --gold-bright: #F5D061; 
    --text: #F8F8F8;
}

html, body { 
    height: 100%; 
    margin: 0; 
    padding: 0; 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Arial', sans-serif; 
    display: flex; 
    flex-direction: column; 
}

/* LA BANNIERE : Encore plus petite et discrète en hauteur */
.banner-img {
    width: 100%;
    height: 110px; /* Hauteur réduite pour un rendu bandeau très propre */
    object-fit: cover; 
    display: block;
}

/* Le Container prend désormais toute la largeur disponible de l'écran */
.container { 
    width: 100%; 
    max-width: 100%;
    margin: 0 auto; 
    padding: 10px 15px; 
    box-sizing: border-box;
    flex: 1 0 auto; 
}

/* LES STATS : Ajustées pour faire TOUTE la largeur de l'écran d'un bout à l'autre */
.dashboard-stats { 
    display: flex; 
    width: 100%; 
    gap: 15px; 
    margin-bottom: 20px; 
    box-sizing: border-box;
}

.stat-box { 
    flex: 1; /* Force les deux blocs à se partager équitablement 100% de la largeur */
    background: #0c0c0c; 
    border: 1px solid rgba(212, 175, 55, 0.25); 
    padding: 12px 20px; 
    border-radius: 6px; 
    text-align: center; 
    box-sizing: border-box;
}

.stat-box h2 { 
    color: var(--gold); 
    font-size: 0.9rem; 
    margin: 0 0 5px 0; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.progress-info { 
    font-size: 1.2rem; 
    font-weight: bold; 
    margin-bottom: 8px; 
}

.progress-bar-container { 
    width: 60%; /* La barre s'étire de façon fluide à l'intérieur du bloc */
    max-width: 300px;
    background: #222; 
    height: 6px; 
    border-radius: 3px; 
    overflow: hidden; 
    margin: 0 auto; 
}

.progress-bar { 
    height: 100%; 
    background: linear-gradient(90deg, #B8860B, #F5D061); 
    transition: width 0.5s; 
}

.total-amount { 
    font-size: 1.6rem; 
    font-weight: bold; 
    color: var(--gold-bright); 
}

/* --- GRILLE 5 COLONNES COMPACTES TOUJOURS VISIBLES --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    direction: rtl;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

.sefer-column { display: flex; flex-direction: column; gap: 4px; }
.sefer-title { 
    text-align: center; 
    color: var(--gold-bright); 
    font-size: 1.05rem; 
    border-bottom: 1px solid var(--gold); 
    padding-bottom: 4px; 
    margin: 0 0 6px 0; 
    direction: ltr; 
    font-weight: bold; 
}

/* Cartes très fines optimisées pour tout afficher sur l'écran d'ordinateur */
.card {
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 38px;
    direction: ltr;
    box-sizing: border-box;
}
.card.available { background: var(--card-avail); border: 1px solid rgba(212, 175, 55, 0.3); }
.card.taken { background: var(--card-taken); border: 1px solid var(--gold); border-left: 4px solid var(--gold); }
.card.partial { background: var(--card-partial); border: 1px solid #4a90e2; border-left: 4px solid #4a90e2; }

.card-names { display: flex; justify-content: space-between; align-items: center; }
.heb { font-size: 1.1rem; font-weight: bold; }
.pho { font-size: 0.75rem; color: #bbb; font-weight: 500; }

.card-taker { font-size: 0.7rem; margin-top: 2px; color: var(--gold-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.card-partial-info { font-size: 0.7rem; margin-top: 2px; color: #4a90e2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- FOOTER TRÈS DISCRET COLLÉ EN BAS --- */
footer {
    flex-shrink: 0;
    background: #000;
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    color: #555;
    border-top: 1px solid #111;
    width: 100%;
}
footer a { color: #888; text-decoration: none; font-weight: bold; }
footer a:hover { color: var(--gold); }

/* Version Mobile responsive */
@media (max-width: 1024px) {
    .grid-container { grid-template-columns: 1fr; direction: ltr; }
    .dashboard-stats { flex-direction: column; }
    .progress-bar-container { width: 80%; }
    .card { min-height: 48px; }
}