.unit-in-location-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}
.unit-xp-bar-container {
    height: 14px;
    background-color: #333;
    border-radius: 7px;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid #555;
}
.unit-xp-bar {
    height: 100%;
    background: linear-gradient(to right, #4CAF50, #81C784);
    border-radius: 7px;
    transition: width 0.3s ease-in-out;
}
.unit-xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000;
}
/* Style pour les rapports annulés */
.report-item.cancelled {
    border-left-color: #6c757d; /* Gris neutre */
}
.outcome.cancelled {
    color: #6c757d;
    font-weight: bold;
}
.location-card-footer {
    border-top: 1px solid #444;
    padding: 8px 12px;
    margin-top: auto; /* Pushes footer to the bottom */
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 13px;
    color: #ccc;
    background-color: #2a2a2e;
}
.location-card-footer span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.location-card-footer .fa-heart { color: #e74c3c; }
.location-card-footer .fa-fist-raised { color: #f39c12; }
.location-card-footer .fa-shield-alt { color: #3498db; }

/* ============================================= */
/* STYLES AMÉLIORÉS: CONVOIS            */
/* ============================================= */

/* Conteneur principal de l'onglet Convois */
#convois-sub-tab .content-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
    align-items: flex-start;
}

/* Style de base pour les cartes */
#convois-sub-tab .card {
    background-color: #2c2c34;
    border: 1px solid #4a4a52;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* En-têtes dans les cartes */
#convois-sub-tab .card h4 {
    color: #e0e0e0;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid #4a4a52;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
#convois-sub-tab .card h4 .fa-search { color: #3498db; }
#convois-sub-tab .card h4 .fa-box-open { color: #f39c12; }
#convois-sub-tab .card h4 .fa-route { color: #2ecc71; }


/* Section de recherche */
.convoy-search-box .input-group {
    margin-bottom: 15px;
}

.search-results {
    margin-top: 15px;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    background-color: #25252b;
    padding: 5px;
}
.search-results p {
    padding: 10px;
    text-align: center;
    color: #999;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.search-result-item:not(:last-child) {
    border-bottom: 1px solid #3a3a42;
}


.search-result-item:hover {
    background-color: #383842;
}

.search-result-item span {
    font-weight: 500;
}

.search-result-item .small-btn {
    background-color: #3498db;
    border: none;
    color: white;
}
.search-result-item .small-btn:hover {
    background-color: #2980b9;
}


/* Section d'envoi */
.resource-slider {
    margin-bottom: 25px;
}
.resource-slider label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #bdc3c7;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.slider-container .input-number {
    width: 120px;
    text-align: center;
    background-color: #25252b;
    border: 1px solid #4a4a52;
    color: #ecf0f1;
}
.slider-container .small-btn {
    flex-shrink: 0;
}

/* Amélioration des sliders */
input[type=range].slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #4a4a52;
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
    background-image: linear-gradient(#3498db, #3498db);
    background-size: 0% 100%;
    background-repeat: no-repeat;
}

input[type=range].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #3498db;
}

input[type=range].slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #3498db;
}

/* Résumé du convoi */
.convoy-summary {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #4a4a52;
}

.convoy-summary p {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 1rem;
    color: #bdc3c7;
}
.convoy-summary p span {
    font-weight: bold;
    color: #fff;
}
.convoy-summary p .text-danger {
    color: #e74c3c !important;
}


/* Section des convois actifs */
.active-convoys-container h5 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #bdc3c7;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.active-convoys-container h5:first-of-type {
    margin-top: 0;
}

.convoy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.convoy-list li {
    background-color: #25252b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease;
}
.convoy-list li:hover {
    transform: translateY(-2px);
}

.convoy-list li .fa-lg {
    font-size: 1.5em;
    margin-right: 5px;
}

.convoy-list li.outgoing { border-left-color: #f39c12; }
.convoy-list li.returning { border-left-color: #2ecc71; }
.convoy-list li.outgoing .fa-truck-loading { color: #f39c12; }
.convoy-list li.returning .fa-undo-alt { color: #2ecc71; }


.convoy-list li > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.convoy-list li .resource-details {
    font-size: 0.9rem;
    color: #bdc3c7;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.convoy-list li .resource-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}


.convoy-timer {
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #fff;
    background-color: #1e1e24;
    padding: 5px 10px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
}

/* ============================================= */
/* STYLES AMÉLIORÉS: AVANT-POSTES                 */
/* ============================================= */
.outposts-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.outpost-card-v2 {
    background: linear-gradient(145deg, #2e2e36, #25252b);
    border: 1px solid #4a4a52;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.outpost-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.outpost-header {
    background-color: rgba(0,0,0,0.2);
    padding: 12px 20px;
    border-bottom: 1px solid #4a4a52;
}
.outpost-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #e0e0e0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.controller-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
}
.controller-banner.status-pve { background: linear-gradient(to right, #c0392b, #922b21); }
.controller-banner.status-enemy { background: linear-gradient(to right, #d35400, #a04000); }
.controller-banner.status-player { background: linear-gradient(to right, #27ae60, #1e8449); }

.outpost-content {
    padding: 20px;
    flex-grow: 1;
}

.outpost-section {
    margin-bottom: 20px;
}
.outpost-section:last-child {
    margin-bottom: 0;
}

.outpost-section h5 {
    margin: 0 0 12px 0;
    color: #bdc3c7;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}
.outpost-section h5 .fa-star { color: #f1c40f; }
.outpost-section h5 .fa-users { color: #3498db; }

.bonus-box p {
    margin: 0;
    font-size: 1.1rem;
    color: #f1c40f;
    font-weight: 500;
    text-align: center;
    background-color: rgba(241, 196, 15, 0.05);
    padding: 10px;
    border-radius: 6px;
}

.garrison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.garrison-unit {
    background-color: #25252b;
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    font-size: 0.9rem;
}

.garrison-unit-name {
    display: block;
    color: #ecf0f1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.garrison-unit-count {
    display: block;
    color: #bdc3c7;
    font-size: 0.85rem;
}

.no-garrison {
    color: #7f8c8d;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.outpost-footer {
    margin-top: auto;
    display: flex;
    gap: 0;
    background-color: #25252b;
    border-top: 1px solid #4a4a52;
}

.action-button {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ecf0f1;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.action-button:not(:last-child) {
    border-right: 1px solid #4a4a52;
}

.action-button:hover { background-color: #4a4a52; }
.action-button.attack-button:hover { background-color: #e74c3c; }
.action-button.reinforce-button:hover { background-color: #2980b9; }
.action-button.recall-button:hover { background-color: #f39c12; color: #1e1e24;}

.action-button.disabled-button {
    background-color: #7f8c8d;
    color: #ccc;
    cursor: not-allowed;
}
.action-button.disabled-button:hover {
     background-color: #7f8c8d;
}


/* Styles pour la modale de sélection d'unités */
.unit-selection-container-modal {
    max-height: 40vh;
    overflow-y: auto;
    background-color: #25252b;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
}

.unit-selection-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #3a3a42;
}
.unit-selection-row:last-child {
    border-bottom: none;
}
.unit-selection-row label {
    color: #ecf0f1;
}

/* ============================================= */
/* STYLES: PAGINATION AVANT-POSTES          */
/* ============================================= */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    margin-top: 16px;
    /* Utilise les mêmes couleurs de bordure que vos cartes */
    border-top: 1px solid #4a4a52; 
}

.pagination-info {
    font-size: 1rem;
    font-weight: bold;
    color: #e0e0e0; /* Couleur de texte claire */
}

.pagination-btn {
    /* Style de base des boutons */
    background-color: #3498db;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: bold;
    
    /* Pour l'icône et le texte */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover {
    background-color: #2980b9; /* Plus foncé au survol */
}

.pagination-btn:disabled {
    /* Style d'un bouton désactivé */
    background-color: #5a5a62;
    color: #999;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background-color: #5a5a62; /* Ne change pas de couleur au survol si désactivé */
}

/* Style du bouton Discord */
.discord-button {
    background-color: #5865F2; /* Bleu Discord officiel */
    color: white;
    border: 1px solid #4752c4;
    border-radius: 5px;
    text-decoration: none; /* Enlève le soulignement du lien */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 7px 10px; /* Même padding que vos autres boutons */
}

.discord-button:hover {
    background-color: #4752c4; /* Couleur au survol */
    color: white;
}

/* S'assurer que l'icône est bien blanche */
.discord-button i {
    color: white;
}

/* --- STYLE ÉDITEUR ANNONCE ADMIN --- */
.admin-editor-container {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    background: #222;
    padding: 5px;
    border: 1px solid #444;
    border-radius: 4px;
    flex-wrap: wrap;
}

.editor-btn {
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background 0.2s;
}

.editor-btn:hover {
    background: #555;
    color: var(--accent-yellow);
}

.editor-textarea {
    width: 100%;
    min-height: 200px; /* Champ plus grand */
    background: #111;
    color: #fff;
    border: 1px solid #444;
    padding: 10px;
    font-family: monospace;
    font-size: 1.1em;
    line-height: 1.5;
    resize: vertical;
}

.editor-help {
    font-size: 0.85em;
    color: #aaa;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-left: 3px solid var(--accent-blue);
}

.editor-preview-label {
    margin-top: 10px;
    font-weight: bold;
    color: var(--accent-yellow);
}

/* Zone d'aperçu dans l'éditeur */
.editor-preview-box {
    display: none; /* Caché par défaut */
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(30, 30, 35, 0.95);
    border: 1px solid var(--accent-yellow); /* Bordure jaune comme l'annonce réelle */
    border-radius: 5px;
    color: #e0e0e0;
    font-family: var(--main-font);
    line-height: 1.5;
    position: relative;
}

.editor-preview-box::before {
    content: "APERÇU VISUEL";
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--accent-yellow);
    color: #000;
    padding: 2px 8px;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 3px;
}

/* --- STYLE DU TUTORIEL ADMIN --- */
.editor-tutorial-box {
    display: none; /* Caché par défaut */
    background-color: #1a1a1a;
    border: 1px solid var(--accent-blue);
    padding: 20px;
    margin-top: 15px;
    border-radius: 5px;
    color: #ddd;
    font-size: 0.95em;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto; /* Scroll si le tuto est long */
}

.editor-tutorial-box h3 {
    color: var(--accent-blue);
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.tuto-section {
    margin-bottom: 20px;
}

.tuto-title {
    font-weight: bold;
    color: var(--accent-yellow);
    display: block;
    margin-bottom: 5px;
}

/* Style pour les exemples de code */
.tuto-code-block {
    background: #000;
    border: 1px solid #444;
    border-left: 3px solid var(--accent-green);
    color: #a7c957; /* Vert clair style terminal */
    padding: 10px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap; /* Conserve les sauts de ligne */
    margin: 5px 0;
    border-radius: 4px;
}

/* Pour mettre en évidence les balises dans le texte */
.tag-highlight {
    background: rgba(255, 255, 255, 0.1);
    color: #ff9800;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
}

/* Correction de l'alignement de la liste Monde Extérieur */
#sidebar-world-timers-list {
    padding-left: 0; /* Enlève le décalage par défaut */
    margin: 0;       /* Enlève les marges par défaut */
    list-style: none; /* Sécurité pour ne pas avoir de puces */
    text-align: left; /* Force l'alignement à gauche */
}

/* Optionnel : Pour bien aligner l'icône et le texte */
#sidebar-world-timers-list li {
    display: flex;
    align-items: center;
    gap: 8px; /* Espace entre l'icône et le texte */
    margin-bottom: 5px; /* Espace entre chaque ligne */
}


/* --- WAR ROOM ATTACK LAYOUT --- */

/* Conteneur principal */
.war-room-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 1. La Route (Origine -> Cible) */
.attack-route-header {
    display: flex;
    align-items: flex-start; /* Aligner en haut pour gérer les hauteurs variables */
    justify-content: space-between;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.route-card {
    flex: 1;
    background: var(--background-color-dark);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

/* Style spécifique Origine (Allié) */
.route-card.origin {
    border-top: 3px solid var(--accent-green);
}
.route-card.origin h4 { color: var(--accent-green); margin: 0; font-size: 1.1em; text-transform: uppercase; }

/* Style spécifique Cible (Ennemi) */
.route-card.target {
    border-top: 3px solid var(--accent-red);
}
.route-card.target h4 { color: var(--accent-red); margin: 0; font-size: 1.1em; text-transform: uppercase; }

/* La Flèche centrale */
.route-arrow {
    align-self: center;
    font-size: 2em;
    color: var(--text-secondary);
    opacity: 0.5;
    animation: pulse-arrow 2s infinite;
}
@keyframes pulse-arrow {
    0% { transform: translateX(0); opacity: 0.3; }
    50% { transform: translateX(5px); opacity: 0.8; }
    100% { transform: translateX(0); opacity: 0.3; }
}

/* Inputs et Selects stylisés */
.war-room-select, .war-room-input {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color-light);
    color: white;
    border-radius: 4px;
}
.war-room-input:focus, .war-room-select:focus {
    border-color: var(--accent-yellow);
    outline: none;
}

/* Info de la cible (masqué par défaut) */
.target-details-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color-light);
    animation: slideDown 0.3s ease-out;
}

/* Choix de la localisation cible (Radio buttons améliorés) */
.target-location-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.location-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.location-radio-label:hover { background: rgba(255,255,255,0.1); }
.location-radio-label input:checked + span { color: var(--accent-red); font-weight: bold; }

/* 2. Sélection des Unités (Pleine largeur) */
.army-composition-panel {
    background: var(--background-color-dark);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.army-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 10px;
}

/* 3. Barre de Lancement (Footer) */
.launch-bar {
    background: linear-gradient(to right, #1a1a1a, #252525);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.travel-time-box {
    text-align: right;
    font-size: 0.9em;
    color: var(--text-secondary);
}
.travel-time-value {
    font-size: 1.4em;
    color: var(--accent-yellow);
    font-weight: bold;
    font-family: monospace;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .attack-route-header { flex-direction: column; }
    .route-arrow { transform: rotate(90deg); margin: 10px 0; }
    .launch-bar { flex-direction: column; text-align: center; }
    .travel-time-box { text-align: center; margin-bottom: 10px; }
}

/* =========================================
   REFONTE ONGLET ARMÉE (GRID VIEW)
   ========================================= */

/* Le conteneur principal des 3 zones */
.armee-garrisons-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Carte de lieu (QG, Dôme...) */
.location-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* En-tête du lieu */
.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.location-header h4 {
    margin: 0;
    color: var(--accent-orange);
    font-family: var(--font-title);
    font-size: 1.1em;
}
.location-stats-mini {
    display: flex;
    gap: 10px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* --- LA GRILLE D'UNITÉS (Le changement majeur) --- */
.army-grid {
    display: grid;
    /* Adapte automatiquement les colonnes : min 80px de large */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* La petite carte d'unité */
.army-unit-chip {
    background-color: var(--bg-card-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.army-unit-chip:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
    background-color: rgba(0, 229, 255, 0.1);
}

.army-unit-chip img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.army-unit-chip .count {
    font-weight: bold;
    color: #fff;
    font-size: 1em;
}

.army-unit-chip .name {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Indicateur visuel "Sélectionné" */
.army-unit-chip.selected {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 10px rgba(255, 196, 0, 0.3);
}

/* --- PANNEAU DE MOUVEMENT AMÉLIORÉ --- */
.movement-panel {
    position: sticky;
    top: 20px; /* Le panneau suit le scroll si la page est longue */
    background: linear-gradient(145deg, var(--bg-card), #1e1e1e);
    border: 1px solid var(--accent-blue);
}

.movement-panel h3 {
    text-align: center;
    color: var(--accent-blue) !important;
}

.movement-visual-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.flow-step {
    text-align: center;
    flex: 1;
}

.flow-step label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
}

.flow-arrow {
    color: var(--accent-blue);
    font-size: 1.2em;
    padding: 0 10px;
}

/* Style des select et inputs */
.modern-select, .modern-input {
    width: 100%;
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: #fff;
    border-radius: 4px;
    font-family: var(--font-main);
}
.modern-select:focus, .modern-input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* Footer Stats (Totaux en bas de carte) */
.location-footer-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.l-stat {
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ccc;
    transition: color 0.2s;
}
.l-stat:hover { color: #fff; }
.l-stat i.fa-heart { color: #ff5252; }
.l-stat i.fa-fist-raised { color: #ffab00; }
.l-stat i.fa-shield-alt { color: #448aff; }

/* =========================================
   MOBILE RESPONSIVE ARMÉE
   ========================================= */

@media (max-width: 950px) {
    /* Passage en colonne unique : Liste au dessus, Actions en dessous */
    .armee-layout {
        grid-template-columns: 1fr !important; /* Force une seule colonne */
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* Le panneau d'actions prend toute la largeur et n'est plus sticky */
    .armee-actions-panel {
        width: 100%;
        position: static; /* Enlève le sticky qui gêne sur mobile */
        order: 2; /* Place les actions SOUS la liste d'armée */
    }

    .armee-garrisons-panel {
        order: 1; /* Place la liste au DESSUS */
    }

    /* Ajustement de la grille pour petits écrans */
    .army-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); /* Tuiles plus petites */
        gap: 5px;
    }

    /* Réduction de la taille des cartes d'unités */
    .army-unit-chip {
        padding: 5px;
        overflow: hidden; /* Empêche tout débordement global */
    }
    .army-unit-chip img {
        width: 35px;
        height: 35px;
        object-fit: contain;
    }
    .army-unit-chip .count {
        font-size: 0.85em; /* Légèrement réduit pour gagner de la place */
        width: 100%;
        text-align: center;
        white-space: nowrap;       /* Interdit le retour à la ligne */
        overflow: hidden;          /* Coupe ce qui dépasse */
        text-overflow: ellipsis;   /* Ajoute "..." si ça dépasse encore */
    }
    .army-unit-chip .name {
        font-size: 0.65em;
        width: 100%;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ajustement du header (Titre + Bouton simu) */
    .armee-header-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
        margin-bottom: 15px;
    }
    .armee-header-controls h2 {
        font-size: 1.2em !important;
    }
    .armee-header-controls button {
        width: 100%;
    }

    /* Ajustement du panneau de flux (Origine -> Destination) */
    .movement-visual-flow {
        padding: 10px;
        gap: 5px;
    }
    .movement-visual-flow .modern-select {
        font-size: 0.9em;
        padding: 6px;
    }

    /* Stats en bas des cartes */
    .location-footer-stats {
        justify-content: space-between;
    }
    .location-footer-stats .l-stat {
        font-size: 0.8em;
    }
}

/* Pour les très petits écrans (mobiles étroits < 400px) */
@media (max-width: 400px) {
    .movement-visual-flow {
        flex-direction: column; /* Empile les selects verticalement */
        gap: 10px;
    }
    .flow-arrow {
        transform: rotate(90deg); /* Flèche vers le bas */
        margin: 5px 0;
    }
    .input-with-max {
        flex-direction: column;
    }
    .input-with-max button {
        width: 100%;
    }
}

/* ========================================= */
/* --- NOUVEAU STYLE DASHBOARD CONVOIS --- */
/* ========================================= */

.convois-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
    align-items: start;
}

@media (max-width: 900px) {
    .convois-dashboard {
        grid-template-columns: 1fr;
    }
}

.convois-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 500px;
}

.panel-header {
    background-color: var(--bg-card-secondary);
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    color: var(--accent-blue);
    font-family: var(--font-title);
    font-size: 1.1em;
}

.panel-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- RECHERCHE --- */
.search-state-empty {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 40px;
}

.big-search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.big-search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-orange);
    font-size: 1.2em;
}

.big-search-box input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background-color: var(--bg-input);
    border: 2px solid var(--border-strong);
    border-radius: 30px;
    color: white;
    font-size: 1.1em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.big-search-box input:focus {
    border-color: var(--accent-orange);
    outline: none;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.search-result-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-card-secondary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search-result-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-blue);
    transform: translateX(5px);
}

.result-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--bg-main);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    margin-right: 15px;
}

.result-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.result-name { font-weight: bold; color: var(--text-main); }
.result-coords { font-size: 0.8em; color: var(--text-secondary); }
.action-icon { color: var(--accent-blue); opacity: 0.5; }

/* --- FORMULAIRE D'ENVOI --- */
.dispatch-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.target-card {
    display: flex;
    align-items: center;
    background-color: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-blue);
    padding: 15px;
    border-radius: 8px;
    gap: 15px;
}

.target-icon {
    font-size: 1.5em;
    color: var(--accent-blue);
}

.target-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.target-info .label { font-size: 0.7em; text-transform: uppercase; color: var(--accent-blue); }
.target-info .value { font-weight: bold; font-size: 1.1em; }

.resources-inputs-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.resource-input-group {
    background-color: var(--bg-card-secondary);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
}

.rations-group { border-left-color: var(--accent-orange); }
.ferraille-group { border-left-color: #aaa; }

.resource-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-secondary);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.input-wrapper input {
    flex-grow: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 8px;
    border-radius: 4px;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
}

.max-btn {
    background-color: var(--border-strong);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8em;
}

.max-btn:hover { background-color: var(--accent-blue); }

.stock-info {
    font-size: 0.8em;
    color: var(--text-secondary);
    display: block;
    text-align: right;
    margin-bottom: 5px;
}

.mini-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-main);
    border-radius: 2px;
}
.mini-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-main);
    border-radius: 50%;
    cursor: pointer;
}

.logistics-summary {
    display: flex;
    gap: 15px;
    background-color: var(--bg-main);
    padding: 15px;
    border-radius: 8px;
}

.summary-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-item i { font-size: 1.5em; color: var(--text-secondary); }

.summary-text { display: flex; flex-direction: column; }
.summary-text span { font-size: 0.8em; color: var(--text-secondary); }
.summary-text strong { font-size: 1.1em; }
.sub-text { font-size: 0.7em; opacity: 0.7; font-weight: normal; }

.action-send-btn {
    padding: 15px;
    font-size: 1.1em;
    letter-spacing: 1px;
}

/* --- RADAR DROITE --- */
.radar-empty {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 50px;
    opacity: 0.5;
}
.radar-empty i { font-size: 4em; margin-bottom: 20px; }

.convoys-lists-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
}

.list-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.convoy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.convoy-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-card-secondary);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.outgoing-item { border-left-color: var(--accent-blue); }
.returning-item { border-left-color: var(--accent-success); opacity: 0.8; }

.convoy-icon {
    font-size: 1.2em;
    color: var(--text-secondary);
    text-align: center;
}

.convoy-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.convoy-target { font-size: 0.95em; color: var(--text-main); }

.convoy-load {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.convoy-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.convoy-timer {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-yellow);
}

.mini-actions {
    display: flex;
    gap: 5px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.9em;
}

.icon-btn:hover { color: white; }
.icon-btn.danger-text:hover { color: var(--accent-red); }