:root {
  --portal-text: #17324d;
  --portal-muted: #5c6f82;
  --portal-border: #d9e1e8;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f5f7f9;
  --portal-radius: 0.5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--portal-text);
  text-rendering: optimizeLegibility;
}

/* Accessibilita base */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -120px;
  z-index: 1200;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: #0d6efd;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

/* Tipografia e leggibilita */
.text-muted,
.small,
.small-muted {
  color: var(--portal-muted) !important;
}

/* Pattern cards/coerenza */
.portal-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  box-shadow: 0 1px 2px rgba(23, 50, 77, 0.04);
}

.portal-card-soft {
  background: var(--portal-surface-soft);
}

/* Tabelle */
.table-responsive,
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  white-space: nowrap;
}

/* Badge e chip */
.badge {
  font-weight: 600;
}

/* Header coerente sulle basi */
.portal-main-body {
  padding-top: 1.5rem;
}

@media (max-width: 991.98px) {
  .portal-main-body {
    padding-top: 1rem;
  }
}
