:root {
  --rcd-space-1: .25rem;
  --rcd-space-2: .5rem;
  --rcd-space-3: .75rem;
  --rcd-space-4: 1rem;
  --rcd-space-5: 1.5rem;
  --rcd-space-6: 2rem;
  --rcd-space-7: 3rem;
  --rcd-border: #d9e2ec;
  --rcd-muted: #52606d;
  --rcd-surface: #f6f8fb;
  --rcd-focus: #ffbf47;
  --rcd-max-text: 76ch;
}

body { font-size: 1rem; line-height: 1.55; }
.rcd-app-shell { padding-top: 2rem; padding-bottom: 4rem; }
.rcd-page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1.5rem; margin-bottom:2rem; }
.rcd-page-header h1 { margin:0 0 .5rem; font-size:clamp(2rem,4vw,3rem); line-height:1.08; }
.rcd-page-header p { max-width:var(--rcd-max-text); color:var(--rcd-muted); margin:0; }
.rcd-kicker { display:block; text-transform:uppercase; letter-spacing:.08em; font-weight:700; font-size:.82rem; margin-bottom:.4rem; color:var(--primary-color,#06c); }
.rcd-actions { display:flex; flex-wrap:wrap; gap:.75rem; }
.rcd-main-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:1.5rem; }
.rcd-user-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:2rem; align-items:start; }
.rcd-user-nav { position:sticky; top:1rem; border:1px solid var(--rcd-border); border-radius:.5rem; background:#fff; padding:.75rem; }
.rcd-user-nav a { display:block; padding:.7rem .8rem; border-radius:.35rem; color:#17324d; text-decoration:none; font-weight:600; }
.rcd-user-nav a:hover,.rcd-user-nav a:focus-visible { background:#eef5ff; }
.rcd-user-nav a.active { background:#06c; color:#fff; }
.rcd-user-nav .rcd-user-nav-label { padding:.55rem .8rem; color:var(--rcd-muted); font-size:.82rem; text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.rcd-panel { background:#fff; border:1px solid var(--rcd-border); border-radius:.55rem; padding:clamp(1rem,2.5vw,2rem); }
.rcd-panel + .rcd-panel { margin-top:1.5rem; }
.rcd-panel h2,.rcd-panel h3 { margin-top:0; }
.rcd-panel-intro { color:var(--rcd-muted); max-width:var(--rcd-max-text); }
.rcd-next-action { border-left:6px solid #06c; background:#eef5ff; }
.rcd-next-action h2 { font-size:1.4rem; }
.rcd-status-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:1rem; }
.rcd-status-item { border-top:3px solid #5c6f82; padding-top:.75rem; }
.rcd-status-item strong { display:block; font-size:1.05rem; }
.rcd-status-item span { display:block; color:var(--rcd-muted); margin-top:.25rem; }
.rcd-profile-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:1rem; }
.professional-profiles-page .rcd-profile-list { grid-template-columns:minmax(0,1fr); }
.rcd-profile-card { border:1px solid var(--rcd-border); border-radius:.5rem; padding:1.25rem; background:#fff; display:flex; flex-direction:column; gap:.85rem; }
.rcd-profile-card h2,.rcd-profile-card h3 { font-size:1.35rem; margin:0; }
.rcd-profile-card p { margin:0; color:var(--rcd-muted); }
.rcd-profile-card .rcd-actions { margin-top:auto; }
.rcd-meta { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.75rem 1.25rem; margin:1rem 0; }
.rcd-meta dt { font-size:.85rem; color:var(--rcd-muted); font-weight:600; }
.rcd-meta dd { margin:0; font-weight:600; }
.rcd-timeline { list-style:none; padding:0; margin:0; }
.rcd-timeline li { position:relative; padding:0 0 1.25rem 1.75rem; border-left:2px solid var(--rcd-border); margin-left:.4rem; }
.rcd-timeline li::before { content:""; position:absolute; left:-.45rem; top:.15rem; width:.8rem; height:.8rem; border-radius:50%; background:#06c; }
.rcd-timeline li:last-child { border-left-color:transparent; }
.rcd-price-list { width:100%; border-collapse:collapse; }
.rcd-price-list th,.rcd-price-list td { padding:.75rem .5rem; border-bottom:1px solid var(--rcd-border); vertical-align:top; }
.rcd-price-list th { text-align:left; }
.rcd-price-list td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.rcd-price-total th,.rcd-price-total td { font-size:1.2rem; border-top:2px solid #17324d; border-bottom:0; }
.rcd-empty { padding:1.5rem; border:1px dashed #9fb3c8; border-radius:.5rem; background:var(--rcd-surface); }
.rcd-form-section { border-top:1px solid var(--rcd-border); padding-top:1.5rem; margin-top:1.5rem; }
.rcd-form-section:first-child { border-top:0; padding-top:0; margin-top:0; }
.rcd-form-section legend { font-size:1.3rem; font-weight:700; margin-bottom:.25rem; }
.rcd-form-help { color:var(--rcd-muted); max-width:var(--rcd-max-text); }
.form-control:focus,.form-select:focus,.form-check-input:focus,.btn:focus-visible,a:focus-visible { outline:3px solid var(--rcd-focus); outline-offset:2px; box-shadow:none!important; }
.rcd-table-wrap { overflow:auto; border:1px solid var(--rcd-border); border-radius:.45rem; }
.rcd-table { width:100%; min-width:720px; border-collapse:collapse; }
.rcd-table th,.rcd-table td { padding:.8rem; border-bottom:1px solid var(--rcd-border); text-align:left; vertical-align:top; }
.rcd-table thead th { position:sticky; top:0; background:#edf2f7; z-index:1; }
.rcd-admin-group { margin-top:1.25rem; }
.rcd-admin-group-title { padding:.45rem .8rem; font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:#aebdcc; font-weight:700; }
.admin-sidebar .nav-link { white-space:normal; line-height:1.2; }
.rcd-alert-detail { margin:.5rem 0 0; }
.rcd-content-width { max-width:var(--rcd-max-text); }
.rcd-public-profiles { padding:3rem 0; background:var(--rcd-surface); }
.rcd-public-profile-card { height:100%; background:#fff; border:1px solid var(--rcd-border); border-radius:.5rem; padding:1.4rem; }
.rcd-public-profile-card h3 { font-size:1.35rem; }
.rcd-recognition-methods { display:flex; flex-wrap:wrap; gap:.5rem; }
.rcd-method-tag { display:inline-flex; padding:.3rem .55rem; background:#eef5ff; border-radius:999px; color:#064c98; font-weight:600; font-size:.9rem; }

/* Backoffice: sidebar chiara, con contrasto esplicito e indipendente dalle utility Bootstrap. */
.admin-sidebar {
  background:#fff!important;
  color:#17324d!important;
  border-right:1px solid #d9e2ec;
  box-shadow:none!important;
}
.admin-sidebar-inner {
  top:0;
  min-height:calc(100vh - 68px);
  max-height:calc(100vh - 68px);
  overflow-y:auto;
  padding:1rem .75rem 1.5rem;
}
.admin-sidebar-menu { gap:.1rem; }
.admin-sidebar .rcd-admin-group-title {
  margin:1.1rem .45rem .35rem;
  padding:.25rem .45rem;
  color:#52606d!important;
  font-size:.74rem;
  line-height:1.25;
}
.admin-sidebar .rcd-admin-group-title:first-child { margin-top:0; }
.admin-sidebar .admin-sidebar-link {
  display:block;
  margin:.1rem 0;
  padding:.62rem .72rem;
  border-radius:.4rem;
  color:#17324d!important;
  background:transparent!important;
  text-decoration:none!important;
  font-weight:600;
  line-height:1.25;
}
.admin-sidebar .admin-sidebar-link:hover,
.admin-sidebar .admin-sidebar-link:focus-visible {
  color:#004d99!important;
  background:#eef5ff!important;
}
.admin-sidebar .admin-sidebar-link.active {
  color:#fff!important;
  background:#0667b7!important;
  box-shadow:inset 4px 0 0 #003b73;
}
.admin-sidebar .admin-sidebar-link-danger { color:#b21f37!important; }
.admin-sidebar .admin-sidebar-link-danger:hover,
.admin-sidebar .admin-sidebar-link-danger:focus-visible {
  color:#8d172a!important;
  background:#fff0f2!important;
}
.admin-sidebar-footer {
  margin-top:1rem;
  padding-top:.75rem;
  border-top:1px solid #d9e2ec;
}

:root[data-theme="dark"] .admin-sidebar {
  background:#161b22!important;
  color:#f0f6fc!important;
  border-right-color:#30363d;
}
:root[data-theme="dark"] .admin-sidebar .rcd-admin-group-title { color:#b1bac4!important; }
:root[data-theme="dark"] .admin-sidebar .admin-sidebar-link { color:#f0f6fc!important; }
:root[data-theme="dark"] .admin-sidebar .admin-sidebar-link:hover,
:root[data-theme="dark"] .admin-sidebar .admin-sidebar-link:focus-visible { background:#21262d!important; }
:root[data-theme="dark"] .admin-sidebar-footer { border-top-color:#30363d; }

@media (max-width: 991.98px) {
  .rcd-user-layout { grid-template-columns:1fr; }
  .rcd-user-nav { position:static; display:flex; overflow-x:auto; gap:.35rem; }
  .rcd-user-nav .rcd-user-nav-label { display:none; }
  .rcd-user-nav a { white-space:nowrap; }
  .rcd-page-header { flex-direction:column; }
  .admin-sidebar-inner { min-height:auto; max-height:calc(100vh - 68px); }
}

@media (max-width: 575.98px) {
  .rcd-app-shell { padding-top:1.25rem; }
  .rcd-panel { padding:1rem; }
  .rcd-actions .btn { width:100%; }
  .rcd-profile-grid { grid-template-columns:1fr; }
  .rcd-table-wrap { border:0; overflow:visible; }
  .rcd-table,.rcd-table tbody,.rcd-table tr,.rcd-table td { display:block; min-width:0; width:100%; }
  .rcd-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .rcd-table tr { border:1px solid var(--rcd-border); border-radius:.45rem; margin-bottom:1rem; padding:.5rem; }
  .rcd-table td { border:0; padding:.45rem; }
  .rcd-table td::before { content:attr(data-label); display:block; color:var(--rcd-muted); font-size:.78rem; font-weight:700; text-transform:uppercase; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}
