:root {
    --poly-blue: #1a365d;
    --poly-gold: #e6a325;
    --poly-bg: #f8fafc;
    --white: #ffffff;
    --red-dev: #e11d48;
}

/* --- STRUCTURE PLEIN ÉCRAN STRICT --- */
html, body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden; 
    font-family: 'Inter', sans-serif;
    background-color: var(--poly-bg);
}

.viewport-slider {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.panels-container {
    display: flex;
    width: 200%; 
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
}

/* --- DESIGN DU DASHBOARD --- */
.dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--poly-gold);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

header h1 { color: var(--poly-blue); margin: 0; font-size: 1.8rem; }
header p { color: #718096; margin: 0; }

/* --- GRILLE AVEC SCROLL INVISIBLE --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    align-items: stretch; /* Conserve la même hauteur pour les cartes d'une même ligne */
    align-content: start; /* Empêche la grille de s'étaler sur toute la hauteur du parent */
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.grid-container::-webkit-scrollbar {
    display: none;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border-top: 5px solid var(--poly-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
    transition: all 0.3s ease;
    
    position: relative;
    display: flex;
    flex-direction: column;
    /* height: 100%;  <-- SUPPRIMÉ pour ne pas forcer la taille du conteneur */
    box-sizing: border-box;
}

.card h3 { margin: 15px 0 10px 0; }
.card p { flex-grow: 1; margin-bottom: 20px; } 

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(26, 54, 93, 0.15);
}

/* --- NOUVELLES MODIFS : INFO & ACTIONS --- */
.btn-info {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--poly-gold);
    cursor: pointer;
    font-size: 1.3rem;
    z-index: 20;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #edf2f7;
}

.action-icon {
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s, transform 0.2s;
}
.edit-icon { color: var(--poly-blue); }
.delete-icon { color: var(--red-dev); }
.action-icon:hover { transform: scale(1.2); }
.edit-icon:hover { color: var(--poly-gold); }

.modal-details-content {
    line-height: 1.6;
    color: #4a5568;
    margin-top: 15px;
    white-space: pre-wrap;
}

.icon-box {
    font-size: 45px;
    color: var(--poly-blue);
    margin-bottom: 15px;
}

/* --- BOUTONS --- */
.btn-main, .btn-create, .btn-cancel, .btn-dev {
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-main, .btn-create { background: var(--poly-blue); color: white; padding: 10px 20px; }
.btn-cancel { background: #eee; color: #4a5568; padding: 10px 20px; flex: 1; }

.btn-main:hover, .btn-create:hover, .btn-cancel:hover, .btn-dev:hover { transform: scale(1.05); }
.btn-main:hover, .btn-create:hover { background: var(--poly-gold); }

/* --- SECTION MAINTENANCE FIXE --- */
.dev-section {
    flex-shrink: 0;
    margin-top: 25px;
    padding: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px dashed var(--poly-blue);
    border-left: 6px solid var(--red-dev);
}

.dev-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.dev-text strong { color: var(--red-dev); display: block; margin-bottom: 5px; font-size: 0.85rem; }
.dev-text p { margin: 0; font-size: 0.8rem; color: #475569; line-height: 1.4; }

.btn-dev {
    background: var(--poly-blue);
    color: white;
    padding: 10px 18px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-dev:hover { background: #0f172a; }

/* --- MODAL --- */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(26, 54, 93, 0.85); align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white; padding: 30px; border-radius: 15px; width: 420px;
    max-height: 85vh; overflow-y: auto;
}

.icon-selector {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin: 15px 0; max-height: 180px; overflow-y: auto; padding: 10px;
    border: 1px solid #edf2f7; border-radius: 8px;
}

.icon-selector i {
    font-size: 24px; padding: 12px; border: 1px solid #eee;
    border-radius: 8px; cursor: pointer; text-align: center;
}

.icon-selector i.active { background: var(--poly-gold); color: white; border-color: var(--poly-gold); }

.icon-selector::-webkit-scrollbar { width: 6px; }
.icon-selector::-webkit-scrollbar-thumb { background: var(--poly-blue); border-radius: 10px; }

input, textarea {
    width: 100%; margin-bottom: 15px; padding: 12px;
    border: 1px solid #e2e8f0; border-radius: 6px; box-sizing: border-box;
}

/* --- ANIMATION SLIDE --- */
.slide-active .panels-container {
    transform: translateX(-50%);
}