/* ============================================
   ALGO CARD — Base
   ============================================ */
.algo-card {
    padding: 15px;
    margin-bottom: 20px;
}

.algo-section {
    margin-bottom: 18px;
}

/* ============================================
   LISTE Répartition
   ============================================ */
.algo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fund-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #222;
}

.fund-line:last-child {
    border-bottom: none;
}


.fund-line.essentiel .fund-name { color: #28a745; }
.fund-line.important .fund-name { color: #ffc107; }
.fund-line.plaisir   .fund-name { color: #b57aff; }

.fund-value {
    font-weight: bold;
    opacity: 0.9;
}

/* ============================================
   LÉGENDE
   ============================================ */
.legend-text {
    font-size: 0.85rem;
    line-height: 1.3;
}

.repartition-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 5px;
}

.repartition-dot.essentiel { background: #28a745; }
.repartition-dot.important { background: #ffc107; }
.repartition-dot.plaisir   { background: #b57aff; }


.algo-info {
    margin-top: 8px;
    font-size: 0.82rem;
    opacity: 0.85;
}

/* ============================================
   COULEURS Fonds (Mes fonds)
   ============================================ */
.solde-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    margin: 4px 0;
    border-radius: 4px;
}

.solde-item.essentiel {
    border-left: 5px solid #28a745;
    background: rgba(40,167,69,0.10);
}

.solde-item.important {
    border-left: 5px solid #ffc107;
    background: rgba(255,193,7,0.10);
}

.solde-item.plaisir {
    border-left: 5px solid #b57aff;
    background: rgba(181,122,255,0.10);
}

/* Mini-légende sous chaque ligne */
.solde-legend-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    margin-bottom: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.essentiel { background: #28a745; }
.legend-dot.important { background: #ffc107; }
.legend-dot.plaisir   { background: #b57aff; }

.legend-small {
    font-size: 0.7rem;
    color: #aaa;
}

/* ============================================
   POPUP
   ============================================ */
.popup.hidden { display: none; }

.popup {
    position: fixed;
    top: 32%;
    left: 50%;
    transform: translate(-50%, -32%);
    width: 260px;

    background: #131226;
    border: 1px solid rgba(130,130,255,0.35);
    border-radius: 10px;

    padding: 14px;
    z-index: 9999;
}

.popup-inner h4 {
    margin-top: 0;
    text-align: center;
    color: #e0e0ff;
    font-size: 0.9rem;
}

.popup-options label {
    display: block;
    margin: 6px 0;
    font-size: 0.82rem;
}

.popup-save,
.popup-close {
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.popup-save {
    background: #3a3f80;
    color: white;
}

.popup-close {
    background: #222;
    color: #ccc;
}

/* ============================================
   P4P4M4M4N block
   ============================================ */
.p4p4-block {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(10, 10, 25, 0.9);
    border: 1px solid rgba(120, 150, 255, 0.35);
    font-size: 0.84rem;
}

.p4p4-block h3 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: #cbd5ff;
}

.p4-line {
    margin: 3px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.p4-amount {
    font-weight: 700;
    color: #7df9ff;
}

.p4-note {
    font-size: 0.78rem;
    opacity: 0.75;
}

/* ============================================
   PRIORITÉS — Version tableau SANS fond
   ============================================ */

.priority-table {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Ligne simple sans fond */
.priority-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto; /* Fond — Prio — Modifier */
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07); /* ligne légère */
}

/* Dernière ligne sans trait */
.priority-row:last-child {
    border-bottom: none;
}

/* Nom du fond */
.p-fund {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Texte de priorité */
.p-prio {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Couleurs selon catégorie */
.p-fund.essentiel, .p-prio.essentiel { color: #28e67b; }
.p-fund.important, .p-prio.important { color: #ffd86b; }
.p-fund.plaisir,   .p-prio.plaisir   { color: #d8a1ff; }

/* Bouton Modifier */
.p-edit {
    all: unset;
    cursor: pointer;
    color: #88aaff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 4px;
    transition: 0.15s ease-in-out;
}

.p-edit:hover {
    color: #ff4d4d !important;
}

/* 50 30 20 couleurs */
/* 50 / 30 / 20 dans le titre */
.card-title .ratio-essentiel {
    color: #28a745;      /* même vert que Essentiel */
    font-weight: 700;
}

.card-title .ratio-important {
    color: #ffc107;      /* même jaune que Important */
    font-weight: 700;
}

.card-title .ratio-plaisir {
    color: #b57aff;      /* même violet que Plaisir */
    font-weight: 700;
}

.card-title .ratio-sep {
    color: #e5e7eb;
    opacity: 0.8;
    margin: 0 2px;
}

.cat5020-edit-btn {
    padding: 4px 8px;
    border-radius: 6px;
    background: #1f2937;
    color: #cbd5ff;
    border: 1px solid #4c1d95;
    cursor: pointer;
    font-size: 0.75rem;
}
.cat5020-edit-btn:hover {
    background: #374151;
}

#cat5020-popup .popup-inner label {
    display: block;
    color: #e5e7ff;
    margin: 6px 0;
}
