/* ===================== WIDGET CYCLE ===================== */
.widget-cycle{display:flex;flex-direction:column;gap:10px}
.cycle-phase{display:flex;align-items:center;gap:12px;background:#fff;padding:12px 14px;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.cycle-phase-emoji{font-size:24px;flex-shrink:0}
.cycle-phase-label{font-weight:600;font-size:14px;color:#333}
.cycle-phase-sub{font-size:12px;color:#666;margin-top:2px}
.cycle-infos{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cycle-info-item{display:flex;align-items:flex-start;gap:6px;background:#faf5f7;padding:8px 10px;border-radius:8px}
.cycle-info-icon{font-size:14px;flex-shrink:0;margin-top:2px}
.cycle-info-label{font-size:9px;color:#888;text-transform:uppercase;letter-spacing:.3px;line-height:1.3;word-break:break-word}
.cycle-info-value{font-size:11px;font-weight:600;color:#333;margin-top:2px;line-height:1.4}
.cycle-progress-wrap{background:#fff;padding:10px 12px;border-radius:8px}
.cycle-progress-label{font-size:11px;color:#666;margin-bottom:6px}
.cycle-progress-bar{height:6px;background:#f0e0ea;border-radius:3px;overflow:hidden}
.cycle-progress-fill{height:100%;border-radius:3px;transition:width .4s ease}
.cycle-actions{display:flex;gap:8px}
.btn-cycle-primary{flex:1;background:#e83e8c;color:#fff;border:none;padding:9px 12px;border-radius:8px;font-weight:600;font-size:12px;cursor:pointer;transition:background .2s}
.btn-cycle-primary:hover{background:#d63384}
.btn-cycle-secondary{background:#f8f9fa;color:#555;border:1px solid #ddd;padding:9px 12px;border-radius:8px;font-weight:600;font-size:12px;cursor:pointer;transition:background .2s}
.btn-cycle-secondary:hover{background:#e9ecef}
.cycle-historique{display:flex;flex-direction:column;gap:2px}
.cycle-historique-item{display:flex;justify-content:space-between;align-items:center;padding:10px 6px;border-bottom:1px solid #f3f4f6}
.cycle-historique-item:last-child{border-bottom:none}
.cycle-histo-detail{display:block;font-size:11px;color:#666;margin-top:2px}
.cycle-histo-notes{display:block;font-size:11px;color:#aaa;font-style:italic;margin-top:2px}
.cycle-error{color:#ef4444}
.cycle-duree-info{font-size:12px;color:#7c3aed;background:#f5f3ff;padding:8px 12px;border-radius:8px;font-weight:600}

/* ===================== MODALE CYCLE — LAYOUT ===================== */
.modal-cycle-main{display:flex;flex-direction:column;gap:0}
.modal-cycle-form{display:flex;flex-direction:column;gap:8px}
.modal-cycle-form label{font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.4px;margin-top:4px}
.modal-cycle-form input,
.modal-cycle-form textarea{width:100%;padding:10px 12px;border:1.5px solid #e5e7eb;border-radius:10px;font-size:14px;box-sizing:border-box;outline:none;font-family:inherit}
.modal-cycle-form input:focus,
.modal-cycle-form textarea:focus{border-color:#e83e8c}
.modal-cycle-form textarea{resize:vertical;min-height:72px}

/* ===================== CALENDRIER ===================== */
.cal-wrap{display:flex;flex-direction:column;gap:10px}

.cal-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.cal-titre{font-weight:700;font-size:15px;color:#333;text-align:center;flex:1}
.cal-nav-btn{background:#f5f3ff;border:none;border-radius:8px;width:34px;height:34px;font-size:20px;cursor:pointer;color:#7c3aed;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s}
.cal-nav-btn:hover{background:#ede9fe}

/* ── GRILLE — c'est ici le fix du bug ── */
.cal-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:3px;
}

.cal-head{font-size:10px;font-weight:700;color:#9ca3af;text-align:center;padding:4px 0;text-transform:uppercase}

.cal-day{
    position:relative;
    aspect-ratio:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    border-radius:8px;
    font-size:12px;
    font-weight:500;
    color:#333;
    cursor:pointer;
    background:#f9fafb;
    transition:background .15s,transform .1s;
    min-height:34px;
    overflow:visible;
}
.cal-day:hover{background:#ede9fe;color:#7c3aed;transform:scale(1.06)}
.cal-empty{background:transparent;cursor:default;pointer-events:none}
.cal-empty:hover{background:transparent;transform:none}

.cal-day.cal-regles{background:#fca5a5;color:#7f1d1d;font-weight:700}
.cal-day.cal-regles:hover{background:#f87171}
.cal-day.cal-fertile{background:#fde68a;color:#78350f;font-weight:600}
.cal-day.cal-fertile:hover{background:#fcd34d}
.cal-day.cal-today{outline:3px solid #4f46e5;outline-offset:-2px;font-weight:800;color:#4f46e5;z-index:1}
.cal-day.cal-regles.cal-today{color:#4f46e5}
.cal-day.cal-fertile.cal-today{color:#4f46e5}

.cal-ovulation-star{position:absolute;top:1px;right:3px;font-size:9px;color:#f59e0b;line-height:1}

.cal-day-icons{display:flex;gap:2px;align-items:center;justify-content:center;margin-top:1px;flex-wrap:wrap}
.cal-icon-rapport{font-size:9px;font-weight:700;line-height:1}
.cal-icon-rapport.protege{color:#10b981}
.cal-icon-rapport.non-protege{color:#e83e8c}
.cal-icon-symptome{font-size:8px;color:#7c3aed;line-height:1}

.cal-legende{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.cal-leg-item{display:flex;align-items:center;gap:4px;font-size:11px;color:#6b7280}
.cal-leg-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;display:inline-block}

/* ===================== JOURNAL / FORMULAIRE ===================== */
.journal-form{display:flex;flex-direction:column;gap:6px}
.journal-section-title{font-size:11px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.5px;margin:8px 0 4px}
.journal-rapport-btns{display:flex;gap:8px}
.btn-rapport{flex:1;padding:9px 12px;border:1.5px solid #e5e7eb;border-radius:8px;background:#f9fafb;color:#6b7280;font-size:13px;font-weight:600;cursor:pointer;transition:all .15s}
.btn-rapport.active{border-color:#e83e8c;background:#fce7f3;color:#e83e8c}
.btn-rapport:hover{border-color:#e83e8c;color:#e83e8c}

.journal-symptomes{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:4px}
.symptome-chip{display:inline-flex;align-items:center;gap:5px;border:1.5px solid #e5e7eb;border-radius:20px;padding:5px 10px;background:#f9fafb;cursor:pointer;font-size:12px;font-weight:500;color:#6b7280;transition:all .15s;user-select:none}
.symptome-chip input{display:none}
.symptome-chip.active{border-color:#7c3aed;background:#ede9fe;color:#7c3aed;font-weight:600}
.symptome-chip:hover{border-color:#7c3aed;color:#7c3aed}
.symptome-chip-icon{font-size:14px;line-height:1}
.symptome-chip-label{line-height:1}

.journal-form textarea{width:100%;padding:10px 12px;border:1.5px solid #e5e7eb;border-radius:10px;font-size:14px;box-sizing:border-box;resize:vertical;min-height:72px;outline:none;font-family:inherit}
.journal-form textarea:focus{border-color:#7c3aed}

/* ===================== WIDGET COULEUR ===================== */
.widget.w-cycle{background:linear-gradient(135deg,#fff0f5 0%,#ffffff 100%)}
.w-cycle .wi{background:#fce7f3}

/* ===================== RESPONSIVE ===================== */
@media(max-width:480px){
    .cal-day{font-size:11px;min-height:30px}
    .cal-head{font-size:9px}
    .cal-nav-btn{width:30px;height:30px;font-size:18px}
    .cal-titre{font-size:13px}
    .cycle-infos{grid-template-columns:1fr 1fr}
}
