/* ===== Module Rendu Espèces ===== */
#rendu-especes {
    margin-top: 22px;
    font-family: 'Segoe UI', sans-serif;
    color: #f5f5ff;
}

/* ---------- Grille principale ---------- */
#rendu-especes .rendu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

#rendu-especes .rendu-field label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

/* Inputs */
#rendu-especes .rendu-field input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #05070d;
    color: #f5f5ff;
}

/* readonly pour total/fond */
#rendu-especes .readonly div {
    padding: 6px 8px;
    border-radius: 6px;
    background: #05070d;
    border: 1px solid #333;
    font-weight: 600;
    text-align: center;
}

/* ---------- Table Articles ---------- */
#rendu-especes .rendu-table-wrapper {
    margin-top: 10px;
    overflow-x: auto;
}

#rendu-especes .rendu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#rendu-especes .rendu-table th,
#rendu-especes .rendu-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #222;
}

#rendu-especes .r_item_name,
#rendu-especes .r_item_amount {
    width: 100%;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #05070d;
    color: #f5f5ff;
}

/* Croix suppression */
#rendu-especes .r_item_delete {
    display: inline-block;
    cursor: pointer;
    color: #ff6b6b;
    font-size: 0.9rem;
    padding: 2px 4px;
    background: transparent;
    border: none;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.2s ease-in-out;
}

#rendu-especes .r_item_delete:hover {
    color: #ff4c4c;
}

/* ---------- Boutons ---------- */
#rendu-especes .rendu-add-btn {
    margin-top: 10px;
    cursor: pointer;
    display: inline-block;
    background: #111;
    border-radius: 6px;
    padding: 4px 8px;
    border: 1px solid #333;
    transition: all 0.2s ease-in-out;
}

#rendu-especes .rendu-add-btn:hover {
    background: #00ff99;
    color: #05070d;
}

/* ---------- Billets & Pièces ---------- */
.rendu-money {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.rendu-money div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px;
    background: #05070d;
    border: 1px solid #333;
    border-radius: 6px;
    min-height: 60px;
    box-sizing: border-box;
    overflow: hidden;
}

.rendu-money label {
    font-size: 0.9rem;
    margin-bottom: 4px;
    width: 100%;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

.money-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #00ff99;
    width: 100%;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .rendu-money {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }

    .rendu-money div {
        min-height: 55px;
    }

    .rendu-money label {
        font-size: 0.8rem;
    }

    .money-count {
        font-size: 1rem;
    }
}

/* ---------- Rendu final ---------- */
.rendu-result-bottom {
    text-align: center;
    margin-top: 12px;
}

.rendu-result-bottom label {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.rendu-result-bottom #change_final_bottom {
    font-size: 1.3rem;
    color: #00ff99;
    font-weight: 700;
}

/* Centimes info */
.rendu-info {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
    font-style: italic;
}

/* Modal Ajuster */
#adjust_money_modal {
    display: none;
    padding: 10px;
    background: #05070d;
    border: 1px solid #333;
    border-radius: 6px;
    margin-top: 10px;
    position: relative;
    z-index: 10;
}

#adjust_money_modal label,
#previous_cash {
    font-size: 0.85rem;
    margin-bottom: 5px;
    display: block;
}

#adjust_money_modal select,
#adjust_money_modal input {
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #05070d;
    color: #f5f5ff;
}

/* ---------- Stepper ---------- */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    user-select: none;
}

.stepper-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
    background: #05070d;
    color: #f5f5ff;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-btn:active {
    background: #00ff99;
    color: #05070d;
}

.stepper-value {
    min-width: 40px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    background: #111;
    border: 1px solid #333;
    color: #00ff99;
}

/* ---------- Responsive Modal ---------- */
@media (max-width: 480px) {
    .stepper-value {
        min-width: 32px;
        font-size: 1em;
    }

    .stepper-btn {
        width: 28px;
        height: 28px;
        font-size: 1em;
    }
}
