/* RC55 - Archivio documentale + stabilizzazione */
.rc55-doc-grid,
.rc55-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.rc55-card {
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.rc55-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rc55-actions a,
.rc55-actions button {
  min-height: 42px;
  border-radius: 12px;
}

.rc55-error {
  border-left: 4px solid #ef4444;
  background: #fff7f7;
  padding: 12px;
  border-radius: 12px;
}

.rc55-ok {
  border-left: 4px solid #22c55e;
  background: #f0fdf4;
  padding: 12px;
  border-radius: 12px;
}

button[disabled],
.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .rc55-doc-grid,
  .rc55-audit-grid {
    grid-template-columns: 1fr;
  }
  .rc55-actions a,
  .rc55-actions button,
  a.btn,
  button.btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* RC55B - Centro Attività, La tua Dashboard e Azioni rapide SOLO in Account */
body:not(.page-account) #rc51ActivityCenter,
body:not(.page-account) [data-rc51-activity-center],
body:not(.page-account) #rc51DashboardWidgets,
body:not(.page-account) [data-rc51-dashboard-widgets],
body:not(.page-account) #rc51QuickActions,
body:not(.page-account) [data-rc51-quick-actions],
body:not(.page-account) #rc55AuditPanel,
body:not(.page-account) [data-rc55-audit-panel] {
  display: none !important;
}

body:not(.page-account) .rc51-card:has(#rc51ActivityCenter),
body:not(.page-account) .rc51-card:has([data-rc51-activity-center]),
body:not(.page-account) .rc51-card:has(#rc51DashboardWidgets),
body:not(.page-account) .rc51-card:has([data-rc51-dashboard-widgets]),
body:not(.page-account) .rc51-card:has(#rc51QuickActions),
body:not(.page-account) .rc51-card:has([data-rc51-quick-actions]) {
  display: none !important;
}

/* RC55C - widget visibili e cliccabili in Account */
.page-account .rc55c-account-widget,
.account-page .rc55c-account-widget,
body .rc55c-account-widget {
  display: block !important;
}

.rc55c-account-widget {
  margin: 12px 0;
}

.rc55c-account-widget a {
  text-decoration: none;
}

/* RC55D - dashboard pulita e widget solo Account */
.card:empty,
section:empty,
.rc51-card:empty,
.rc55-card:empty,
.dashboard .card:empty,
.home-dashboard .card:empty {
  display: none !important;
}

.rc-empty-slot,
.rc55d-hidden,
[data-empty-slot="1"] {
  display: none !important;
}

/* Questi blocchi non devono comparire in Home/Dashboard */
body:not(.rc55d-account-page) .rc55c-account-widget,
body:not(.rc55d-account-page) #rc51ActivityCenter,
body:not(.rc55d-account-page) #rc51DashboardWidgets,
body:not(.rc55d-account-page) #rc51DashboardSettings,
body:not(.rc55d-account-page) #rc51QuickActions {
  display: none !important;
}

/* In Account invece devono essere visibili */
body.rc55d-account-page .rc55c-account-widget,
body.rc55d-account-page #rc51ActivityCenter,
body.rc55d-account-page #rc51DashboardWidgets,
body.rc55d-account-page #rc51DashboardSettings,
body.rc55d-account-page #rc51QuickActions {
  display: block !important;
}
/* RC55H: Home pulita, personalizzazione dashboard solo in Account */
body.page-dashboard .rc13-dashboard-toolbar,
body.page-dashboard .rc13-favorite-pages,
body.page-dashboard #rc51DashboardSettings,
body.page-dashboard [data-rc51-dashboard-settings],
body.page-dashboard .rc55c-account-widget { display:none!important; }
.dashboard-pref-list{display:flex;flex-direction:column;gap:10px;width:100%}
.dashboard-pref-item{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;border:1px solid #e5e7eb;border-radius:14px;padding:12px;background:#fff}
.dashboard-pref-main label{display:block;margin-bottom:4px}.dashboard-pref-main small{display:block}.dashboard-pref-controls{display:flex;gap:6px;align-items:center}.dashboard-pref-controls input[type=number]{width:82px}.dashboard-pref-disabled{opacity:.55;background:#f8fafc}
@media(max-width:760px){.dashboard-pref-item{grid-template-columns:1fr}.dashboard-pref-controls{justify-content:space-between}.dashboard-pref-controls .btn{min-width:44px;min-height:40px}.dashboard-pref-controls input[type=number]{width:72px}.account-dashboard-settings .form{display:block}.account-dashboard-settings .field.full{margin-top:12px}}
