/* Condominio Gest — stili propri (sopra assets/app.css) */

.badge-warn { background: #b4530922; color: #b45309; border-color: #b4530944 }
.badge-grey { background: #64748b22; color: #64748b; border-color: #64748b44 }
.btn-ghost { background: transparent; color: var(--blu); border: 1px solid #cbd5e1 }

/* selettore del condominio nella testata */
.sel-cond { display: inline-block; margin: 0 }
.sel-cond select {
  max-width: 44vw; padding: 4px 8px; border-radius: 8px; border: 1px solid #ffffff44;
  background: #ffffff1a; color: #fff; font-size: .85rem; font-weight: 600;
}
.sel-cond select option { color: #111 }
@media (min-width: 720px) { .sel-cond select { max-width: 320px } }

/* testata della scheda condominio */
.testata-cond { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin: 4px 0 12px }
.testata-cond h1 { margin: 0; font-size: 1.25rem; line-height: 1.25 }
.testata-cond .hint { margin: 2px 0 0 }
.es-chip { display: flex; flex-direction: column; gap: 2px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px; font-size: .85rem }
.es-chip strong { font-size: 1rem }
.pill-tabs.sotto { margin-top: -6px; opacity: .95 }

/* tabelle dati */
.tab-dati { width: 100%; border-collapse: collapse; font-size: .9rem }
.tab-dati th, .tab-dati td { padding: 7px 8px; border-bottom: 1px solid #e8edf2; text-align: left; vertical-align: top }
.tab-dati th { background: #f6f8fa; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; color: #475569; white-space: nowrap }
.tab-dati td.n, .tab-dati th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.tab-dati tr.tot-r td { border-top: 2px solid var(--blu); font-weight: 700; background: #f8fafc }
.tab-dati tr.sub td { background: #fbfcfd; font-weight: 600 }
.tab-dati tbody tr:hover { background: #f9fbfd }
.tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px }
.tab-dati input[type=number], .tab-dati input[type=text] { width: 100%; min-width: 72px; padding: 4px 6px; font-size: .88rem }
.neg { color: #b91c1c }
.pos { color: #15803d }

/* elenco a righe cliccabili */
.righe { display: flex; flex-direction: column; gap: 6px }
.riga-el {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #fff; border: 1px solid #e6ebf0; border-radius: 12px;
  text-decoration: none; color: inherit;
}
.riga-el:hover { border-color: var(--blu); box-shadow: 0 2px 10px #0f172a0d }
.riga-el .tit { font-weight: 600 }
.riga-el .sub { font-size: .82rem; color: #64748b }
.riga-el .dx { text-align: right; white-space: nowrap }
.riga-el.sc-ko { border-left: 4px solid #dc2626 }
.riga-el.sc-warn { border-left: 4px solid #d97706 }
.riga-el.sc-ok { opacity: .6 }

/* KPI a griglia */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 }
.kpi-box { background: #fff; border: 1px solid #e6ebf0; border-radius: 12px; padding: 10px 12px }
.kpi-box .v { font-size: 1.25rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums }
.kpi-box .l { font-size: .78rem; color: #64748b; text-transform: uppercase; letter-spacing: .02em }
.kpi-box.ko .v { color: #b91c1c }
.kpi-box.ok .v { color: #15803d }

/* ELISA: i controlli */
.elisa { background: linear-gradient(180deg, #ffffff, #f8fbfa); border: 1px solid #d7e3e0; border-radius: 14px; padding: 12px; margin: 10px 0 }
.elisa h2 { margin: 0 0 4px; font-size: 1rem; display: flex; align-items: center; gap: 8px }
.elisa .chi { width: 30px; height: 30px; border-radius: 50%; background: var(--blu); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem }
.avviso { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #eef2f5 }
.avviso:first-of-type { border-top: 0 }
.avviso .pin { font-size: 1.05rem; line-height: 1.2 }
.avviso .tit { font-weight: 650 }
.avviso .txt { font-size: .87rem; color: #475569 }
.avviso .norma { font-size: .78rem; color: var(--oro); font-weight: 600 }
.avviso.ko .tit { color: #b91c1c }
.avviso.warn .tit { color: #b45309 }

/* quorum */
.quorum { display: grid; gap: 8px; grid-template-columns: 1fr 1fr }
@media (max-width: 560px) { .quorum { grid-template-columns: 1fr } }
.quorum .q { border: 1px solid #e6ebf0; border-radius: 12px; padding: 10px; background: #fff }
.barra { height: 8px; border-radius: 99px; background: #e8edf2; overflow: hidden; margin: 6px 0 4px }
.barra i { display: block; height: 100%; background: var(--blu) }
.barra.ok i { background: #15803d }
.barra.ko i { background: #dc2626 }
.esito { padding: 10px 12px; border-radius: 12px; font-weight: 600; margin: 8px 0 }
.esito.ok { background: #dcfce7; color: #14532d; border: 1px solid #86efac }
.esito.ko { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5 }

/* voti in assemblea */
.voto-riga { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid #e6ebf0; border-radius: 10px; background: #fff; margin-bottom: 6px }
.voto-btn { display: flex; gap: 4px }
.voto-btn button { border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 5px 9px; font-size: .85rem; cursor: pointer }
.voto-btn button.on[data-v=favore] { background: #15803d; color: #fff; border-color: #15803d }
.voto-btn button.on[data-v=contro] { background: #dc2626; color: #fff; border-color: #dc2626 }
.voto-btn button.on[data-v=astenuto] { background: #64748b; color: #fff; border-color: #64748b }

/* form a due colonne */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px }
.form-grid .full { grid-column: 1 / -1 }
label.campo { display: block; font-size: .82rem; font-weight: 600; color: #475569; margin-bottom: 10px }
label.campo input, label.campo select, label.campo textarea {
  width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: .95rem; font-family: inherit;
}
label.campo textarea { min-height: 80px; resize: vertical }
label.campo .aiuto { display: block; font-weight: 400; color: #94a3b8; font-size: .76rem; margin-top: 2px }
fieldset.blocco { border: 1px solid #e6ebf0; border-radius: 12px; padding: 12px; margin: 0 0 12px }
fieldset.blocco legend { font-size: .82rem; font-weight: 700; color: var(--blu); padding: 0 6px }

/* stampa */
body.stampa { background: #eef2f6 }
.barra-stampa { display: flex; gap: 8px; justify-content: center; padding: 10px; background: #fff; border-bottom: 1px solid #e2e8f0 }
.foglio {
  background: #fff; max-width: 820px; margin: 14px auto 40px; padding: 26px 30px;
  box-shadow: 0 2px 18px #0f172a1a; font-size: .92rem; color: #111;
}
.foglio h1 { font-size: 1.2rem; margin: 0 0 2px }
.foglio h2 { font-size: 1rem; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--blu) }
.foglio h3 { font-size: .92rem; margin: 12px 0 4px }
.foglio .intest { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--blu); padding-bottom: 8px; margin-bottom: 14px }
.foglio .piede { margin-top: 26px; padding-top: 8px; border-top: 1px solid #cbd5e1; font-size: .8rem }
.foglio .dx { text-align: right }
.foglio p { margin: 6px 0; line-height: 1.5 }
.foglio .firma { margin-top: 34px; display: flex; justify-content: space-between; gap: 30px }
.foglio .firma div { flex: 1; border-top: 1px solid #333; padding-top: 4px; font-size: .8rem; text-align: center }
.foglio table { width: 100%; border-collapse: collapse; font-size: .84rem; margin: 6px 0 }
.foglio th, .foglio td { border: 1px solid #b8c4d0; padding: 4px 6px; text-align: left }
.foglio th { background: #eef2f6; font-size: .78rem }
.foglio td.n, .foglio th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.foglio tr.tot-r td { font-weight: 700; background: #f4f7fa }
@media print {
  body.stampa { background: #fff }
  .no-print { display: none !important }
  .foglio { box-shadow: none; margin: 0; max-width: none; padding: 0 }
  .rompi { page-break-before: always }
  .insieme { page-break-inside: avoid }
}

/* portale del condomino */
body.pub .wrap { max-width: 640px }
.sal-box { text-align: center; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid #e6ebf0; margin-bottom: 12px }
.sal-box .v { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums }
.sal-box.debito .v { color: #b91c1c }
.sal-box.pari .v { color: #15803d }

/* varie */
.vuoto { text-align: center; color: #64748b; padding: 22px 12px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px }
.barra-azioni { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 }
.solo-pc { display: none }
@media (min-width: 720px) { .solo-pc { display: inline } }
.mini { font-size: .8rem; color: #64748b }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #f1f5f9; border: 1px solid #e2e8f0; font-size: .78rem; margin: 0 3px 3px 0 }
.chip.ruolo-conduttore { background: #fef3c7; border-color: #fde68a }
.chip.ruolo-usufrutto, .chip.ruolo-nuda { background: #e0e7ff; border-color: #c7d2fe }
.avatar { border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; color: #fff; font-size: .7rem }
.chip-ruolo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #fff }
details.acc { border: 1px solid #e6ebf0; border-radius: 12px; padding: 8px 12px; background: #fff; margin-bottom: 8px }
details.acc > summary { cursor: pointer; font-weight: 600; list-style: none }
details.acc > summary::-webkit-details-marker { display: none }
details.acc > summary::before { content: '▸ '; color: var(--blu) }
details.acc[open] > summary::before { content: '▾ ' }
.causale { font-family: ui-monospace, monospace; font-size: .8rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-word }
