/* Rosy & Vale - UI unificata V8.3.5
   Riferimento grafico: area Clienti Convenzionati.
   Questo foglio viene caricato per ultimo per uniformare progressivamente
   template storici senza modificare la logica applicativa. */
:root{
  --rvui-blue:#1769d2;--rvui-blue-soft:#eaf3ff;--rvui-green:#54b900;
  --rvui-orange:#ffb300;--rvui-red:#dc3545;--rvui-purple:#6f42c1;
  --rvui-ink:#16324f;--rvui-muted:#6b7d90;--rvui-line:#dce5ed;
  --rvui-bg:#f5f8fb;--rvui-card:#fff;--rvui-radius:15px;
  --rvui-shadow:0 4px 14px rgba(27,58,87,.07);
}
html,body{max-width:100%;overflow-x:hidden}
body.rv-unified{background:var(--rvui-bg);color:var(--rvui-ink)}
body.rv-unified main.container{max-width:1540px;width:100%}
body.rv-unified h1,body.rv-unified h2,body.rv-unified h3{letter-spacing:-.015em}

/* Superfici e pannelli */
body.rv-unified .card,
body.rv-unified .card-main,
body.rv-unified .table-card,
body.rv-unified .conv-panel,
body.rv-unified .rv-panel,
body.rv-unified .external-main-card,
body.rv-unified .lista-card{
  border:1px solid var(--rvui-line)!important;border-radius:var(--rvui-radius)!important;
  background:var(--rvui-card);box-shadow:var(--rvui-shadow)!important;
}

/* Pulsanti e campi: misure coerenti e facilmente premibili */
body.rv-unified .btn{border-radius:9px;font-weight:700;min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
body.rv-unified .btn-sm{min-height:36px}
body.rv-unified .btn-primary{background:#1674df;border-color:#1674df}
body.rv-unified .btn-success{background:var(--rvui-green);border-color:var(--rvui-green)}
body.rv-unified .btn-warning{background:var(--rvui-orange);border-color:var(--rvui-orange);color:#17212b}
body.rv-unified .form-control,body.rv-unified .form-select{min-height:44px;border-radius:10px!important;border-color:#cfdbe5;background:#fff}
body.rv-unified .form-label{color:#35516d;font-weight:700}
body.rv-unified .badge{border-radius:999px;padding:.45em .7em}

/* Tabelle desktop nello stile Convenzionati */
body.rv-unified table.table{margin-bottom:0}
body.rv-unified table.table thead th{background:#f1f5f8;color:#334e68;border-bottom:1px solid #d6e0e8;font-size:.78rem;text-transform:uppercase;letter-spacing:.025em;padding:11px 10px;vertical-align:middle}
body.rv-unified table.table td{padding:11px 10px;vertical-align:middle;border-color:#e8eef3}
body.rv-unified table.table tbody tr:hover{background:#f8fbff}

/* Barre azione/filtri comuni */
body.rv-unified .rv-operativa-wrap,
body.rv-unified .work-toolbar,
body.rv-unified .filter-panel,
body.rv-unified .filters-card{
  border:1px solid var(--rvui-line)!important;border-radius:14px!important;background:#fff!important;box-shadow:0 3px 10px rgba(27,58,87,.05)!important;
}
body.rv-unified .rv-operativa-main,body.rv-unified .rv-operativa-sub{flex-wrap:wrap;overflow:visible!important}
body.rv-unified .rv-operativa-main>* ,body.rv-unified .rv-operativa-sub>*{min-width:140px}

/* Servizi esterni: niente caroselli orizzontali */
body.rv-unified .external-page .external-nav{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px!important;overflow:visible!important;padding-bottom:0!important}
body.rv-unified .external-page .btn-round{width:100%!important;min-width:0!important;min-height:46px;height:auto!important;white-space:normal!important}

/* Dashboard reparti: filtri sempre a capo invece dello scroll laterale */
body.rv-unified .dept-page .filter-row{overflow:visible!important;flex-wrap:wrap!important;padding-bottom:0!important}
body.rv-unified .dept-page .filter-chip{min-height:40px;white-space:normal}

/* Titoli/pagine esistenti armonizzati */
body.rv-unified .rv-page-head,
body.rv-unified .dept-head,
body.rv-unified .rv-price-head{
  border-color:var(--rvui-line)!important;box-shadow:var(--rvui-shadow)!important;border-radius:15px!important;
}
body.rv-unified .rv-page-title,body.rv-unified .dept-title h1,body.rv-unified .rv-price-title h1{color:#132b45!important;font-weight:800!important}

/* Mobile: tabelle -> schede, azioni grandi, nessun overflow */
@media(max-width:767.98px){
  body.rv-unified main.container{padding-left:8px;padding-right:8px}
  body.rv-unified .btn:not(.btn-close){min-height:44px}
  body.rv-unified .btn-group{display:flex;flex-wrap:wrap;gap:6px}
  body.rv-unified .btn-group>.btn{flex:1 1 130px;border-radius:9px!important}
  body.rv-unified .table-responsive{overflow:visible!important;max-width:100%!important}
  body.rv-unified table.rv-mobile-cards{display:block!important;width:100%!important;min-width:0!important;border:0!important}
  body.rv-unified table.rv-mobile-cards thead{display:none!important}
  body.rv-unified table.rv-mobile-cards tbody{display:grid!important;width:100%!important;gap:10px}
  body.rv-unified table.rv-mobile-cards tr{display:block!important;width:100%!important;margin:0!important;padding:10px 12px!important;border:1px solid var(--rvui-line)!important;border-radius:13px!important;background:#fff!important;box-shadow:0 2px 8px rgba(27,58,87,.045)!important}
  body.rv-unified table.rv-mobile-cards td{display:grid!important;grid-template-columns:minmax(92px,35%) minmax(0,1fr);gap:8px;width:100%!important;max-width:100%!important;border:0!important;border-bottom:1px solid #edf1f4!important;padding:7px 0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere;align-items:start}
  body.rv-unified table.rv-mobile-cards td:last-child{border-bottom:0!important}
  body.rv-unified table.rv-mobile-cards td::before{content:attr(data-label);font-size:.75rem;text-transform:uppercase;letter-spacing:.02em;color:var(--rvui-muted);font-weight:800;line-height:1.35}
  body.rv-unified table.rv-mobile-cards td[colspan]::before{content:none}
  body.rv-unified table.rv-mobile-cards td[colspan]{display:block!important}
  body.rv-unified table.rv-mobile-cards td .d-flex,body.rv-unified table.rv-mobile-cards td form.d-flex{flex-wrap:wrap!important;gap:6px}
  body.rv-unified table.rv-mobile-cards td .btn{min-width:44px}

  body.rv-unified .external-page .external-nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.rv-unified .work-list{grid-template-columns:1fr!important}
  body.rv-unified .work-meta{grid-template-columns:1fr!important}
  body.rv-unified .rv-home-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.rv-unified .rv-home-link,body.rv-unified .rv-home-link-btn{min-width:0;padding:11px!important;gap:9px!important}
  body.rv-unified .rv-home-link-icon{width:44px!important;height:44px!important;flex:0 0 44px!important}
  body.rv-unified .rv-home-link-desc{font-size:.78rem!important}
}
@media(max-width:430px){
  body.rv-unified .external-page .external-nav{grid-template-columns:1fr!important}
  body.rv-unified .rv-home-grid{grid-template-columns:1fr!important}
  body.rv-unified table.rv-mobile-cards td{grid-template-columns:1fr;gap:3px}
}

/* Dettagli secondari: base comune per sezioni progressive/collassabili */
body.rv-unified details.rv-secondary{border:1px solid var(--rvui-line);border-radius:12px;background:#fff;margin-bottom:10px;overflow:hidden}
body.rv-unified details.rv-secondary>summary{cursor:pointer;padding:11px 13px;font-weight:800;color:#35516d;background:#f7fafc;list-style:none}
body.rv-unified details.rv-secondary>summary::-webkit-details-marker{display:none}
body.rv-unified details.rv-secondary>summary::after{content:'+';float:right;font-size:1.2rem;line-height:1}
body.rv-unified details.rv-secondary[open]>summary::after{content:'−'}
body.rv-unified details.rv-secondary>.rv-secondary-body{padding:12px 13px}
