/* Calcolatore foxhub — stile del widget. Usa le variabili del tema se presenti. */
.rc-calc {
    --rc-brand: var(--brand, #2563eb);
    --rc-ink: var(--ink, #0f172a);
    --rc-muted: var(--muted, #64748b);
    --rc-border: var(--border, #e2e8f0);
    --rc-bg-alt: var(--bg-alt, #f1f5f9);
    --rc-surface: var(--surface, #ffffff);
    margin: 8px 0;
}

.rc-calc__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ---- Form ---- */
.rc-calc__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border: 1px solid var(--rc-border);
    border-radius: 14px;
    padding: 22px;
    background: var(--rc-surface);
}
.rc-field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.rc-field label { font-weight: 600; color: var(--rc-ink); }
.rc-field input[type="number"],
.rc-field select {
    padding: 10px 12px;
    border: 1px solid var(--rc-border);
    border-radius: 10px;
    font: inherit;
    background: var(--rc-surface);
    color: var(--rc-ink);
    width: 100%;
}
.rc-field input:focus, .rc-field select:focus { outline: 2px solid var(--rc-brand); border-color: var(--rc-brand); }
.rc-field--check { justify-content: end; }
.rc-field--check label { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.rc-field--full { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 18px; }
.rc-field__legend { font-weight: 600; }
.rc-radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.rc-radio small { color: var(--rc-brand); font-weight: 700; }

/* ---- Riepilogo ---- */
.rc-calc__riepilogo {
    border: 1px solid var(--rc-border);
    border-radius: 14px;
    padding: 22px;
    background: var(--rc-bg-alt);
    position: sticky;
    top: 84px;
}
.rc-riepilogo__titolo { margin: 0 0 14px; font-size: 1.2rem; }
.rc-riepilogo__voci { list-style: none; margin: 0 0 16px; padding: 0; }
.rc-riepilogo__voci li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 7px 0; border-bottom: 1px dashed var(--rc-border);
    font-size: .95rem;
}
.rc-riepilogo__voci li span:first-child { color: var(--rc-muted); }
.rc-sconto { color: #15803d; font-weight: 700; }

.rc-riepilogo__totale {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
    padding: 12px 0; border-top: 2px solid var(--rc-ink);
}
.rc-riepilogo__totale > span:first-child { font-weight: 600; }
.rc-riepilogo__totale strong { font-size: 1.9rem; color: var(--rc-brand); margin-left: auto; }
.rc-riepilogo__periodo { color: var(--rc-muted); }
.rc-riepilogo__annuo { color: var(--rc-muted); font-size: .95rem; min-height: 1.2em; margin-top: 4px; }

.rc-btn {
    display: block; text-align: center; margin: 18px 0 12px;
    padding: 13px 20px; border-radius: 999px;
    background: var(--rc-brand); color: #fff; font-weight: 700;
}
.rc-btn:hover { background: var(--brand-dark, #1d4ed8); color: #fff; text-decoration: none; }
.rc-nota { font-size: .8rem; color: var(--rc-muted); margin: 0; }

/* ---- Editor: piede con subtotale + bottone aggiungi ---- */
.rc-vm-foot {
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--rc-border);
    padding-top: 16px;
    margin-top: 4px;
}
.rc-vm-sub { font-size: .98rem; color: var(--rc-ink); }
.rc-vm-sub strong { color: var(--rc-brand); font-size: 1.15rem; }
.rc-vm-sub span { color: var(--rc-muted); }
.rc-btn--add {
    margin: 0;
    padding: 10px 18px;
    background: transparent;
    color: var(--rc-brand);
    white-space: nowrap;
    border: 2px solid var(--rc-brand);
    cursor: pointer;
    font: inherit;
}
.rc-btn--add:hover { background: var(--rc-brand); color: #fff; }

/* ---- Lista delle VM nel preventivo ---- */
.rc-preventivo__voci { margin-bottom: 14px; }
.rc-empty { color: var(--rc-muted); font-size: .9rem; margin: 0 0 4px; }
.rc-voce {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    padding: 10px 0; border-bottom: 1px dashed var(--rc-border);
}
.rc-voce__desc { font-size: .9rem; line-height: 1.4; }
.rc-voce__desc strong { color: var(--rc-brand); }
.rc-voce__dx { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .9rem; }
.rc-voce__rm {
    border: 1px solid var(--rc-border); background: var(--rc-surface); color: var(--rc-muted);
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer; line-height: 1;
    font-size: .8rem; padding: 0;
}
.rc-voce__rm:hover { color: #b91c1c; border-color: #b91c1c; }

/* ---- Selettore fatturazione nel preventivo ---- */
.rc-durata { margin: 10px 0 6px; gap: 16px; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .rc-calc__grid { grid-template-columns: 1fr; }
    .rc-calc__riepilogo { position: static; }
}
@media (max-width: 520px) {
    .rc-calc__form { grid-template-columns: 1fr; }
}
