:root {
  --primary: #123c7c;
  --primary-2: #0b63ce;
  --primary-3: #eaf3ff;
  --gold: #f2b705;
  --gold-soft: #fff6d6;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --border: #d9e4f2;
  --text: #172033;
  --muted: #68758a;
  --danger: #b42318;
  --success: #027a48;
  --shadow: 0 14px 35px rgba(16, 40, 90, 0.12);
  --shadow-soft: 0 8px 22px rgba(16, 40, 90, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 99, 206, 0.12), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #eef3fa 100%);
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  position: relative;
  background: linear-gradient(135deg, #0c2f66 0%, #0b63ce 62%, #2a87ff 100%);
  color: white;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 85% 0%, rgba(242, 183, 5, 0.22), transparent 28%);
  pointer-events: none;
}

.header-content {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 22px 30px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-box {
  width: 92px;
  height: 92px;
  background: white;
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.45);
}

.logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-box.logo-missing::after {
  content: "SGS";
  color: var(--primary);
  font-size: 26px;
  font-weight: 900;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.brand h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 7px 0 0;
  color: rgba(255,255,255,0.86);
  font-size: 16px;
}

.main-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.btn {
  border: 0;
  background: white;
  color: var(--primary);
  padding: 11px 15px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 6px 14px rgba(10, 40, 90, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(10, 40, 90, 0.16);
}

.nav-btn {
  background: rgba(255,255,255,0.94);
}

.nav-admin {
  background: var(--gold);
  color: #1f2b43;
}

.primary,
button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}

.action-btn {
  margin-top: 16px;
  padding: 12px 18px;
}

button.small,
.btn.small {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--primary-2);
  color: white;
}

.page-shell {
  max-width: 1220px;
  margin: -18px auto 32px;
  padding: 0 22px;
  position: relative;
  z-index: 2;
}

.sezione {
  display: none;
}

.sezione.active {
  display: block;
}

.hero-card,
.panel,
.card,
.evento-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(217, 228, 242, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, rgba(242, 183, 5, 0.28), transparent 65%);
  pointer-events: none;
}

.hero-card h2 {
  margin: 0 0 9px;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.hero-card p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.small-hero {
  margin-top: 8px;
}

.admin-hero {
  border-color: rgba(242, 183, 5, 0.45);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  background: linear-gradient(135deg, white, #f7fbff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  width: 7px;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, var(--primary-2), var(--gold));
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  color: var(--primary);
}

.panel,
.card {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.panel-title h3,
.card h3 {
  margin: 0;
  color: var(--primary);
  font-size: 22px;
}

.muted {
  color: var(--muted);
  margin-top: 0;
  line-height: 1.5;
}

.mt {
  margin-top: 14px;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 6px;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 14px;
  background: white;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.12);
}

.lista {
  margin-top: 18px;
}

.titolo-risultati {
  background: linear-gradient(135deg, #eef5ff, white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0 16px;
  box-shadow: var(--shadow-soft);
}

.titolo-risultati h3 {
  margin: 0 0 7px;
  color: var(--primary);
}

.titolo-risultati p {
  margin: 0;
  color: var(--muted);
}

.societa-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 0;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.societa-card-header {
  background:
    linear-gradient(135deg, rgba(18,60,124,0.96), rgba(11,99,206,0.92)),
    radial-gradient(circle at right, rgba(242,183,5,0.35), transparent 40%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.societa-card-header h3 {
  margin: 0;
  color: white;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.societa-card-header p {
  margin: 7px 0 0;
  color: rgba(255,255,255,0.84);
}

.societa-card-header span {
  background: var(--gold);
  color: #1f2b43;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
  font-size: 13px;
}

.societa-info {
  padding: 15px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.societa-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.raduni-lista {
  padding: 6px 20px 20px;
}

.raduno-riga {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.raduno-riga:last-child {
  border-bottom: 0;
}

.raduno-data {
  background: var(--gold-soft);
  color: #7a5600;
  border: 1px solid rgba(242,183,5,0.45);
  border-radius: 14px;
  padding: 11px;
  text-align: center;
  font-weight: 900;
}

.raduno-dati p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.35;
}

.raduno-dati strong {
  color: var(--primary);
}

.raduno-azioni {
  display: flex;
  justify-content: flex-end;
}

.evento-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.evento-header h3 {
  margin: 0;
  color: var(--primary);
}

.evento-header span {
  background: var(--primary-3);
  color: var(--primary);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: bold;
  white-space: nowrap;
}

.azioni {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.loading,
.empty,
.error {
  background: white;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 14px;
  box-shadow: var(--shadow-soft);
}

.error {
  color: var(--danger);
  border-color: #fecdca;
  background: #fff5f5;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  background: #eef5ff;
  color: var(--primary);
  font-weight: 900;
}

tr:hover td {
  background: #fbfdff;
}

.azioni-cell {
  white-space: nowrap;
}

.admin-access-box {
  display: flex;
  align-items: flex-end;
}

.site-footer {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px;
  color: var(--muted);
}

.site-footer div {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer strong {
  color: var(--primary);
}

@media (max-width: 850px) {
  .header-content {
    align-items: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  .logo-box {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .brand h1 {
    font-size: 27px;
  }

  .page-shell {
    margin-top: -10px;
    padding: 0 14px;
  }

  .hero-card {
    padding: 21px;
  }

  .hero-card h2 {
    font-size: 24px;
  }

  .grid-2,
  .grid-3,
  .stats,
  .societa-info {
    grid-template-columns: 1fr;
  }

  .societa-card-header {
    flex-direction: column;
  }

  .raduno-riga {
    grid-template-columns: 1fr;
  }

  .raduno-data {
    text-align: left;
  }

  .raduno-azioni {
    justify-content: flex-start;
  }

  .main-nav {
    width: 100%;
  }

  .main-nav button {
    flex: 1;
  }
}

.hidden {
  display: none !important;
}

.section-heading {
  color: var(--primary);
  margin: 24px 0 14px;
}

.societa-access-card {
  border-left: 6px solid var(--primary-2);
}

.evento-edit-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.evento-edit-header h4 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
}

.evento-edit-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7a5600;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.ok {
  background: #e7f8ef;
  color: var(--success);
}

.scheda-open-day-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfdff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8);
}

.scheda-open-day-box h4 {
  margin: 0 0 16px;
  color: var(--primary);
  font-size: 22px;
}

.form-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.form-section h5,
.terms-box h5 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 16px;
}

.date-orari-box {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.data-ora-riga {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.add-btn {
  background: var(--gold);
  color: #1f2b43;
  box-shadow: none;
}

.danger-btn {
  background: #fee4e2 !important;
  color: var(--danger) !important;
  box-shadow: none;
}

.terms-box {
  background: #fffdf3;
  border: 1px solid rgba(242,183,5,0.45);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.terms-box p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  margin-top: 12px;
}

.check-label input {
  width: auto;
}

.success-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: #e7f8ef;
  color: var(--success);
  font-weight: 800;
  margin-bottom: 14px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  align-items: start;
}

.link-btn {
  background: transparent;
  color: var(--primary-2);
  box-shadow: none;
  padding-left: 0;
  margin-top: 10px;
  text-decoration: underline;
}

.link-btn:hover {
  box-shadow: none;
}

@media (max-width: 850px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

.societa-selected-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef5ff;
  border: 1px solid var(--border);
}

.societa-selected-box p {
  margin: 4px 0;
  font-size: 13px;
}

#admin-report-richieste {
  margin-top: 16px;
}

#admin-report-richieste input {
  min-width: 130px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.danger-btn {
  background: #fee4e2 !important;
  color: var(--danger) !important;
}

#tabella-admin input,
#tabella-admin select {
  min-width: 120px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 12px;
}

#tabella-admin td {
  vertical-align: middle;
}

#tabella-admin .azioni-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Istruzioni pulsanti Open Day */
.open-day-istruzioni {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #f7f9fc;
  font-size: 13px;
  line-height: 1.45;
  color: #26384d;
}

.open-day-istruzioni > div {
  margin-bottom: 5px;
}

.open-day-istruzioni > div:last-child {
  margin-bottom: 0;
}

.open-day-istruzioni .open-day-avviso {
  margin-top: 9px;
  padding: 9px 10px;
  border-left: 4px solid #c98600;
  background: #fff8e6;
  font-weight: 600;
  color: #684900;
}

/* Area società Open Day guidata */
.open-day-guida {
  margin-top: 18px;
  border-left: 5px solid #123c7c;
}

.open-day-guida h3 {
  margin-top: 0;
}

.open-day-passaggi {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.open-day-passaggi > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.passaggio-numero {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #123c7c;
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.open-day-passaggi p {
  margin: 3px 0 0;
  color: #59697b;
}

.open-day-nota-unica {
  margin-top: 15px;
  padding: 11px 13px;
  background: #eef5ff;
  border-radius: 8px;
  font-weight: 600;
  color: #123c7c;
}

.open-day-elenco {
  display: grid;
  gap: 18px;
}

.open-day-card {
  border: 1px solid #d9e1eb;
}

.open-day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.open-day-titolo {
  font-size: 17px;
  font-weight: 800;
  color: #123c7c;
}

.open-day-data-principale {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 700;
}

.open-day-riepilogo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 9px;
  color: #4e5e70;
}

.open-day-azioni-principali {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.open-day-modifica,
.scheda-open-day-box {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid #d7e0eb;
  border-radius: 10px;
  background: #f9fbfd;
}

.open-day-avviso-reinvio {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 5px solid #d99000;
  background: #fff6dd;
  color: #654600;
}

.open-day-conferma-invio {
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 5px solid #25854a;
  background: #edf9f1;
  color: #185f34;
}

.status-pill.warning {
  background: #fff0c7;
  color: #725000;
  border: 1px solid #ebc45e;
}

@media (max-width: 700px) {
  .open-day-card-header {
    flex-direction: column;
  }

  .open-day-azioni-principali {
    flex-direction: column;
  }

  .open-day-azioni-principali .btn,
  .open-day-azioni-principali button {
    width: 100%;
    text-align: center;
  }
}

.open-day-giornate {
  margin: 10px 0;
  padding: 11px 13px;
  background: #f4f7fb;
  border-radius: 9px;
}

.open-day-giornate ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.open-day-giornate li {
  margin: 4px 0;
}

/* =========================================================
   DISTINZIONE VISIVA OPEN DAY / CAMP E CENTRI ESTIVI
========================================================= */

.tipo-attivita-intestazione {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.tipo-attivita-intestazione h3,
.tipo-attivita-intestazione h4,
.titolo-card-attivita h4 {
  margin: 0;
}

.tipo-attivita-intestazione p {
  margin: 5px 0 0;
}

.tipo-attivita-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tipo-attivita-badge.piccolo {
  padding: 6px 9px;
  font-size: 10px;
}

.tipo-open-day .tipo-attivita-badge,
.titolo-card-attivita .tipo-attivita-badge {
  color: #ffffff;
  background: #123c7c;
}

.tipo-centro-estivo .tipo-attivita-badge,
.centro-estivo-card .tipo-attivita-badge {
  color: #ffffff;
  background: #23834b;
}

.sezione-attivita-titolo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 15px;
  padding: 16px 18px;
  border-radius: 14px;
}

.sezione-attivita-titolo h3 {
  margin: 0;
}

.sezione-attivita-titolo p {
  margin: 4px 0 0;
  font-size: 13px;
}

.sezione-attivita-titolo.tipo-open-day {
  border: 1px solid #bfd0eb;
  background: #f3f7fd;
}

.sezione-attivita-titolo.tipo-centro-estivo {
  border: 1px solid #bcdcc7;
  background: #f1faf4;
}

.titolo-card-attivita {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}

.open-day-card-guidata {
  border-left: 5px solid #123c7c;
}

.centro-estivo-card {
  border-left: 5px solid #23834b;
}

.centro-estivo-card .tipo-attivita-badge {
  background: #23834b;
}

.centro-estivo-bozza-info {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #d5e4da;
  border-radius: 12px;
  background: #f6fbf7;
}

.centro-estivo-bozza-info p {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .tipo-attivita-intestazione,
  .sezione-attivita-titolo {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Raggruppamento ordinato delle tipologie nell'area società */

.inserimento-attivita-card {
  margin-top: 16px;
  margin-bottom: 18px;
}

.inserimento-attivita-card.tipo-open-day {
  border: 1px solid #bfd0eb;
  border-left: 5px solid #123c7c;
  background: #fbfdff;
}

#sezione-centri-estivi-societa {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 3px solid #d9e4dd;
}

#sezione-centri-estivi-societa > .open-day-guida {
  border-left: 5px solid #23834b;
}

@media (max-width: 700px) {
  .inserimento-attivita-card .evento-edit-header {
    align-items: stretch;
    flex-direction: column;
  }

  .inserimento-attivita-card .action-btn {
    width: 100%;
  }
}

/* =========================
   HOME PUBBLICA - AREE AFFIANCATE
========================= */

.home-attivita-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.home-attivita-grid > .home-attivita-card {
  margin: 0;
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.home-attivita-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
}

.home-open-day-card::before {
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--primary-2)
  );
}

.home-centro-estivo-card::before {
  background: linear-gradient(
    90deg,
    #23834b,
    #42a96b
  );
}

.home-attivita-card .action-btn {
  width: 100%;
  margin-top: 18px;
}

.home-centro-estivo-card .primary {
  background: linear-gradient(
    135deg,
    #17673a,
    #2b9a59
  );
}

.home-attivita-card > .lista {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .home-attivita-grid {
    grid-template-columns: 1fr;
  }

  .home-attivita-grid > .home-attivita-card {
    height: auto;
  }
}

/* Barra orizzontale superiore per le tabelle larghe */
.table-scroll-top {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 8px 0 6px;
  height: 18px;
  border: 1px solid #d8e2f3;
  border-radius: 8px;
  background: #f7faff;
}

.table-scroll-top-inner {
  height: 1px;
}

.table-scroll-top.is-hidden {
  display: none;
}


/* =========================================================
   MODALITÀ E REQUISITI
========================================================= */

.nav-requisiti {
  font-weight: 700;
}

.requisiti-hero {
  margin-bottom: 22px;
}

.requisiti-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 22px;
  align-items: start;
}

.requisiti-card {
  line-height: 1.7;
}

.requisiti-card h3,
.requisiti-card h4 {
  margin-top: 0;
}

.requisiti-card h4 {
  margin-top: 24px;
  margin-bottom: 10px;
}

.requisiti-card p {
  margin: 12px 0;
}

.requisiti-elenco,
.requisiti-numerati {
  padding-left: 22px;
}

.requisiti-elenco li,
.requisiti-numerati li {
  margin-bottom: 10px;
}

.requisiti-numerati li {
  padding-left: 6px;
}

.requisiti-avviso,
.requisiti-scadenza {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 14px;
}

.requisiti-avviso {
  border-left: 5px solid #c83f49;
  background: #fff5f5;
}

.requisiti-scadenza {
  border-left: 5px solid #17745b;
  background: #effaf6;
}

.requisiti-avviso p,
.requisiti-scadenza p {
  margin-bottom: 0;
}

.requisiti-azioni {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .requisiti-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .requisiti-card {
    padding: 18px;
  }

  .requisiti-avviso,
  .requisiti-scadenza {
    padding: 14px;
  }

  .requisiti-elenco,
  .requisiti-numerati {
    padding-left: 20px;
  }
}

/* =========================================================
   REPORT ADMIN CAMP / CENTRI ESTIVI
   Visualizzazione completa dei dati nelle celle
   ========================================================= */

.report-centri-estivi-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
}

.report-centri-estivi-table {
  width: max-content;
  min-width: 2500px;
  table-layout: fixed;
}

.report-centri-estivi-table th,
.report-centri-estivi-table td {
  min-width: 170px;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.report-centri-estivi-table th:nth-child(1),
.report-centri-estivi-table td:nth-child(1) {
  width: 130px;
  min-width: 130px;
}

.report-centri-estivi-table th:nth-child(2),
.report-centri-estivi-table td:nth-child(2) {
  width: 270px;
  min-width: 270px;
}

.report-centri-estivi-table th:nth-child(3),
.report-centri-estivi-table td:nth-child(3) {
  width: 230px;
  min-width: 230px;
}

.report-centri-estivi-table th:nth-child(4),
.report-centri-estivi-table td:nth-child(4) {
  width: 340px;
  min-width: 340px;
}

.report-centri-estivi-table th:nth-child(5),
.report-centri-estivi-table td:nth-child(5) {
  width: 180px;
  min-width: 180px;
}

.report-centri-estivi-table th:nth-child(6),
.report-centri-estivi-table td:nth-child(6),
.report-centri-estivi-table th:nth-child(7),
.report-centri-estivi-table td:nth-child(7) {
  width: 290px;
  min-width: 290px;
}

.report-centri-estivi-table th:nth-child(8),
.report-centri-estivi-table td:nth-child(8) {
  width: 85px;
  min-width: 85px;
}

.report-centri-estivi-table th:nth-child(9),
.report-centri-estivi-table td:nth-child(9) {
  width: 175px;
  min-width: 175px;
}

.report-centri-estivi-table input,
.report-centri-estivi-table select,
.report-centri-estivi-table textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 7px;
}

.report-centri-estivi-table .ce-campo-multilinea {
  display: block;
  min-height: 42px;
  padding: 10px 11px;
  resize: vertical;
  overflow: hidden;
  line-height: 1.4;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report-centri-estivi-table .ce-campo-multilinea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.report-centri-estivi-table label {
  display: block;
  margin: 4px 0 5px;
  font-size: 12px;
  font-weight: 800;
}

.report-centri-estivi-table .azioni-cell {
  white-space: normal;
}

.report-centri-estivi-table .azioni-cell button {
  width: 100%;
  margin-bottom: 7px;
}

/* =========================================================
   RADUNI E PROVINI
   Prima struttura grafica integrata nel portale
   ========================================================= */

.tipo-raduno .tipo-attivita-badge,
.home-raduni-card .tipo-attivita-badge {
  background: #e8f1ff;
  border-color: #b7d3ff;
  color: #174a91;
}

.tipo-provino .tipo-attivita-badge,
.home-provini-card .tipo-attivita-badge {
  background: #fff3df;
  border-color: #ffd49b;
  color: #8a4b00;
}

.home-raduni-card {
  border-top: 4px solid #2866b1;
}

.home-provini-card {
  border-top: 4px solid #d87900;
}

.modulo-in-preparazione {
  margin: 16px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.modulo-in-preparazione strong {
  display: block;
  margin-bottom: 5px;
}

.modulo-in-preparazione p {
  margin: 0;
  color: var(--muted);
}

.dashboard-attivita-societa {
  margin: 22px 0;
}

.societa-attivita-grid {
  margin-bottom: 24px;
}

@media (min-width: 1050px) {
  .home-attivita-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   MODULO RADUNI - AREA SOCIETÀ
   ========================================================= */

.raduni-area-societa {
  border-top: 4px solid #2866b1;
  margin-bottom: 22px;
}

.raduni-elenco-intestazione {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.raduni-elenco-intestazione h4 {
  margin: 0;
}

.raduno-form-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #b7d3ff;
  border-radius: var(--radius);
  background: #f8fbff;
}

.raduno-form-card textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.raduno-sottotitolo {
  margin: 24px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}

.raduno-dichiarazioni {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.raduno-bozza-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.check-row span {
  line-height: 1.45;
}

.grid-3 {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 850px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
