/* Mobile overlay to close sidebar */
.mobile-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 900; display: none; }

/* Index frame layout: rimuovi qualsiasi spazio tra header e iframe */
.main-header { margin: 0 !important; padding-bottom: 0 !important; }
.main-content { margin-top: 0 !important; padding-top: 0 !important; }
.page-body { margin: 0 !important; padding: 0 !important; height: 100%; }
#page-container { margin: 0 !important; padding: 0 !important; }
.page-iframe, #page-frame { display: block; width: 100%; height: 100%; border: 0; margin: 0; padding: 0; }

/* Spazio minimo per il contenuto dashboard sotto l'header (solo index) */
body.index-page #dashboard-page { padding-top: .35rem; }
.mobile-overlay.active { display: block; }
/* Dettagli Socio: form pagamento compatto */
.soci-dashboard #form-pagamento .form-row { gap: .5rem; margin-bottom: .5rem; }
.soci-dashboard #form-pagamento .form-group { margin-bottom: .4rem; }
.soci-dashboard #form-pagamento .form-group label { margin-bottom: .15rem; font-size: .8rem; }
.soci-dashboard #form-pagamento input,
.soci-dashboard #form-pagamento select { padding: .45rem .6rem; font-size: .85rem; }

/* =============================
   Ricevute: Filters styling
   ============================= */
body.ricevute-page .filters { 
  background: #fff; 
  border: 1px solid var(--border-color); 
  border-radius: var(--border-radius); 
  padding: .5rem .75rem; 
  margin: .35rem 0 .75rem; 
  display: flex; 
  align-items: flex-end; 
  gap: .75rem; 
  flex-wrap: wrap;
}
body.ricevute-page .filters-inline { display:flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
body.ricevute-page .filters .filter-group { display:flex; flex-direction: column; gap: .25rem; }
body.ricevute-page .filters .filter-group label { font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
body.ricevute-page .filters .filter-group select,
body.ricevute-page .filters .filter-group input[type="text"],
body.ricevute-page .filters .filter-group input[type="date"] {
  height: 32px; padding: 0 .6rem; font-size: .85rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background:#fff; line-height: 1.2;
}
body.ricevute-page .filters .filter-group select:focus,
body.ricevute-page .filters .filter-group input:focus { outline:none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
body.ricevute-page .filters .filter-actions { display:flex; align-items:center; gap:.5rem; margin-left:auto; }
body.ricevute-page .filters .filter-group-inline { display:flex; align-items:center; gap:.35rem; }
body.ricevute-page .filters .btn { height: 32px; padding: 0 .6rem; font-size: .8rem; }

/* Dettagli Istruttore: form pagamento compatto */
.istruttori-dashboard #form-pagamento-istruttore .form-row { gap: .5rem; margin-bottom: .5rem; }
.istruttori-dashboard #form-pagamento-istruttore .form-group { margin-bottom: .4rem; }
.istruttori-dashboard #form-pagamento-istruttore .form-group label { margin-bottom: .15rem; font-size: .8rem; }
.istruttori-dashboard #form-pagamento-istruttore input,
.istruttori-dashboard #form-pagamento-istruttore select,
.istruttori-dashboard #form-pagamento-istruttore textarea { padding: .45rem .6rem; font-size: .85rem; }

/* Ultra-compact on mobile */
@media (max-width: 640px) {
  .soci-dashboard #form-pagamento .form-row,
  .istruttori-dashboard #form-pagamento-istruttore .form-row { gap: .35rem; margin-bottom: .35rem; }
  .soci-dashboard #form-pagamento .form-group,
  .istruttori-dashboard #form-pagamento-istruttore .form-group { margin-bottom: .3rem; }
  .soci-dashboard #form-pagamento .form-group label,
  .istruttori-dashboard #form-pagamento-istruttore .form-group label { margin-bottom: .1rem; font-size: .8rem; }
  .soci-dashboard #form-pagamento input,
  .soci-dashboard #form-pagamento select,
  .istruttori-dashboard #form-pagamento-istruttore input,
  .istruttori-dashboard #form-pagamento-istruttore select,
  .istruttori-dashboard #form-pagamento-istruttore textarea { padding: .35rem .5rem; font-size: .8rem; }
}
/* Table container: consistent white card look across pages */
.table-container {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: .25rem; /* uniforme tra soci e corsi */
  margin-bottom: 1.5rem; /* compatto */
}


.table-responsive { overflow-x: auto; background: #fff; padding-bottom: 1rem; }

/* Charts section (Index) */
body.index-page .charts-section { margin-top: .75rem; }
body.index-page .charts-header { display:flex; align-items:center; justify-content: space-between; gap:.75rem; margin-bottom:.5rem; }
body.index-page .charts-title { margin: 0; display:flex; align-items:center; gap:.5rem; font-weight:600; color: var(--text-primary, #111827); font-size:.95rem; }
body.index-page .charts-controls select { padding:.35rem .5rem; border:1px solid var(--gray-200); border-radius:8px; font-size:.8rem; }
body.index-page .charts-controls .btn { padding:.35rem .6rem; font-size:.8rem; }
body.index-page .charts-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:.75rem; }
body.index-page .charts-card { background:#fff; border:1px solid var(--gray-200); border-radius:12px; padding:.5rem; box-shadow: var(--shadow-sm); }
body.index-page .charts-card canvas { width:100% !important; height:200px !important; }
/* Spaziatura uniforme fondo frame su Index */
body.index-page .page-container { padding-bottom: 1rem !important; }
@media (max-width: 768px) {
  body.index-page .page-container { padding-bottom: 1rem !important; }
}

/* Export page */
body.export-page .export-dashboard { width: 100%; }
/* Page container without extra padding and with 1600px cap like other pages */
body.export-page .container { max-width: none; width: 100%; margin: 0; }
body.export-page .page-container { padding: 0; }
body.export-page .header-actions { padding: .75rem 1rem; margin-bottom: .5rem; }
body.export-page .form-container { padding: 1rem 1.25rem; margin-bottom: 1rem; }
body.export-page .export-buttons { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1rem; }
body.export-page .export-button { background: var(--primary-color); color:#fff; border:none; padding:1.25rem; border-radius:12px; cursor:pointer; font-weight:600; text-align:center; display:flex; flex-direction:column; align-items:center; gap:.5rem; box-shadow: var(--shadow-sm); transition: all .2s ease; }
body.export-page .export-button:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
body.export-page .export-button .icon { font-size: 2rem; }
body.export-page .export-button .title { font-size: .95rem; }
body.export-page .export-button .description { font-size: .8rem; opacity:.9; }
body.export-page .export-button.export-speciale { background: linear-gradient(135deg, var(--success-color), #059669); border:1px solid var(--success-color); }
body.export-page .export-button.export-speciale:hover { background: linear-gradient(135deg, #059669, #047857); }
@media (max-width: 768px) {
  body.export-page .page-container { padding: 0; }
  body.export-page .export-button { padding: 1rem; }
  body.export-page .export-button .icon { font-size: 1.6rem; }
}

/* Ricevute page: full width */
body.ricevute-page .container { width: 100%; max-width: none; margin: 0; padding: 0; }
body.ricevute-page .page-container { padding: 0; }
/* Use global .header-actions spacing (0.5rem / 0.75rem) */
body.ricevute-page .settings-card { background: #fff; border: none; border-radius: var(--border-radius); padding: 1rem; box-shadow: none; }
/* Bottoni compatti nelle colonne Socio/Stato della tabella ricevute */
body.ricevute-page .movimenti-table .btn-table { font-size: .65rem !important; padding: .15rem .35rem !important; line-height: 1.1; border-radius: 6px; }

/* Export header meta badges */
body.export-page .export-meta { display:flex; align-items:center; gap:.5rem; flex-wrap: wrap; margin-top:.35rem; }
body.export-page .badge { display:inline-flex; align-items:center; gap:.35rem; background: var(--primary-light); color: var(--primary-color); border:1px solid var(--primary-color); padding:.2rem .5rem; border-radius:999px; font-size:.75rem; font-weight:600; }
body.export-page .badge .dot { width:8px; height:8px; border-radius:50%; background: currentColor; display:inline-block; }
@media (max-width: 640px) {
  body.export-page .header-actions { padding: .75rem 1rem; }
  body.export-page .export-buttons { gap: .5rem; }
  body.export-page .export-button { padding: .75rem; }
  body.export-page .export-button .icon { font-size: 1.4rem; }
  body.export-page .export-button .title { font-size: .9rem; }
  body.export-page .export-button .description { font-size: .75rem; }
}

/* Soci page: align layout to fornitori-page (full width, no extra padding) */
body.soci-page .container { width: 100%; max-width: none; margin: 0; padding: 0; }
body.soci-page .page-container { padding: 0; }
/* Add comfortable inner margins for fields inside forms on soci-page */
body.soci-page .form-container { padding: 1.25rem 1.5rem; }
body.soci-page .form-row { padding-left: 1rem; padding-right: 1rem; }
body.soci-page .form-group { margin-bottom: 1rem; }
@media (max-width: 640px) {
  body.soci-page .form-row { padding-left: 1rem; padding-right: 1rem; }
}

/* Corsi page: align layout and inner spacing a layout full-width */
body.corsi-page .container { width: 100%; max-width: none; margin: 0; padding: 0 1rem; }
body.corsi-page .page-container { padding: 0; }
body.corsi-page .form-container { padding: 1.25rem 1.5rem; }
body.corsi-page .form-row { padding-left: 1rem; padding-right: 1rem; }
body.corsi-page .form-group { margin-bottom: 1rem; }
body.corsi-page .form-group label { margin-bottom: .35rem; }
body.corsi-page input,
body.corsi-page select,
body.corsi-page textarea { padding: .6rem .8rem; }
body.corsi-page .checkbox-list { margin-top: .25rem; }
@media (max-width: 640px) {
  body.corsi-page .form-row { padding-left: 1rem; padding-right: 1rem; }
}

/* Global layout: contenuti full-width con padding laterale uniforme */
.container { max-width: none !important; width: 100% !important; margin: 0 !important; padding-left: 1rem !important; padding-right: 1rem !important; }
.page-container { padding-left: 0 !important; padding-right: 0 !important; }

/* Make settings cards and generic cards borderless app-wide */
.settings-card, .card { border: none !important; box-shadow: none !important; }

/* Ensure table wrappers stretch full width */
.table-responsive { width: 100% !important; }

/* Strong full-width overrides for specific dashboards */
body.soci-dashboard .container,
body.corsi-dashboard .container,
body.ricevute-page .container,
body.export-page .container,
body.impostazioni-page .container { max-width: none !important; width:100% !important; margin:0 !important; }

/* Catch-all: qualsiasi *container* wrapper è full width, ma non forziamo padding qui per evitare conflitti locali */
[class*="container"], [class^="container"], [class$="container"] {
  max-width: none !important; width: 100% !important; margin: 0 !important;
}

/* Final hard overrides for Soci e Corsi dashboards */
body.soci-dashboard .page-container,
body.corsi-dashboard .page-container,
body.soci-dashboard .content,
body.corsi-dashboard .content,
body.soci-dashboard .main,
body.corsi-dashboard .main,
body.soci-dashboard .main-content,
body.corsi-dashboard .main-content,
body.soci-dashboard .page,
body.corsi-dashboard .page,
body.soci-dashboard .page-content,
body.corsi-dashboard .page-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Support underscore variants and generic contains for body class names */
body.soci_dashboard .container,
body.soci_dashboard .page-container,
body.corsi_dashboard .container,
body.corsi_dashboard .page-container,
body[class*="soci"] .container,
body[class*="soci"] .page-container,
body[class*="corsi"] .container,
body[class*="corsi"] .page-container,
body[class*="soci"] .content,
body[class*="soci"] .main,
body[class*="soci"] .main-content,
body[class*="soci"] .page,
body[class*="soci"] .page-content,
body[class*="corsi"] .content,
body[class*="corsi"] .main,
body[class*="corsi"] .main-content,
body[class*="corsi"] .page,
body[class*="corsi"] .page-content,
body[class*="soci"] [class*="container"],
body[class*="corsi"] [class*="container"] {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Statistiche page: full width */
body.statistiche-page .container { max-width: none; width:100%; margin: 0; }
body.statistiche-page .page-container { padding: 0; }

/* Dashboard quick menu grid: enforce 2x2 on medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
  body.index-page .dashboard-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* Contabilità: stats cards più piccole e simmetriche */
body.contabilita-page .stats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; }
body.contabilita-page .stat-card { padding: .9rem; border-radius: 12px; text-align:center; }

/* ===== Global full-width/borderless reinforcements (apply to all remaining pages) ===== */
/* Notifiche email form container */
.email-form-container { max-width: none !important; width: 100% !important; margin: 0 !important; }
.email-form-section { border: none !important; box-shadow: none !important; }

/* Auth / Login / Logout pages */
.auth-container, .login-container, .logout-container, .auth-landing-card { max-width: none !important; width: 100% !important; margin: 0 !important; border: none !important; box-shadow: none !important; background: #fff; }

/* Generic panels/cards */
.panel, .panel-card, .widget, .widget-card { border: none !important; box-shadow: none !important; }

/* Ensure headers/filters wrap full width */
.header-actions, .filters { width: 100% !important; }
body.contabilita-page .stat-number { font-size: 1.6rem; font-weight: 700; line-height: 1; }
body.contabilita-page .stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ===== Auth Pages (login/logout/landing) ===== */
body.auth-page,
body.login-page,
body.logout-page,
body.auth-landing-page {
  --auth-gradient-from: #667eea;
  --auth-gradient-to: #764ba2;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--auth-gradient-from) 0%, var(--auth-gradient-to) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Ambient ornaments for auth background */
body.auth-page::before,
body.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body.auth-page::before {
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(255,255,255,.12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255,255,255,.08), transparent 60%);
  mix-blend-mode: screen;
}
body.auth-page::after {
  background:
    radial-gradient(600px 300px at 80% 10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(500px 250px at 10% 90%, rgba(0,0,0,.08), transparent 60%);
}

.auth-container,
.login-container,
.logout-container,
.auth-landing-card {
  width: 100%;
  max-width: none;
  background: rgba(255,255,255,.9);
  color: var(--gray-800, #1f2937);
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 1.5rem;
  backdrop-filter: saturate(120%) blur(8px);
}

/* Modern narrow auth layouts */
body.login-page .login-container { max-width: 420px !important; padding: 1.5rem 1.75rem; }
body.logout-page .logout-container { max-width: 540px !important; padding: 1.5rem 1.75rem; }
@media (max-width: 480px) {
  body.login-page .login-container,
  body.logout-page .logout-container { padding: 1.25rem; }
}

@media (min-width: 640px) {
  .auth-container,
  .login-container,
  .logout-container,
  .auth-landing-card { padding: 2rem; }
}

.login-header { text-align:center; margin-bottom: 1rem; }
.login-title { margin:.5rem 0 0; font-weight:700; color:#111827; }

.logo-container { display:flex; align-items:center; justify-content:center; margin-bottom: 1rem; }
.logo-img { width: 200px; height: 72px; object-fit: contain; border-radius: 12px; background: #f8fafc; border:1px solid #e5e7eb; padding:.5rem; }

.form-group { margin-bottom: .85rem; }
.form-group label { display:block; margin-bottom: .3rem; font-weight:600; color:#374151; font-size:.9rem; }
.form-input { width:100%; padding:.65rem .8rem; border:1.8px solid #e5e7eb; border-radius:10px; font-size:.95rem; background:#f9fafb; transition:.2s ease; }
.form-input:focus { outline:none; border-color: var(--primary-color, #3b82f6); background:#fff; box-shadow: 0 0 0 4px rgba(59,130,246,.08); }

.password-input-container { position:relative; display:flex; align-items:center; }
.password-input-container .form-input { padding-right: 2.25rem; }
.password-toggle { position:absolute; right:.5rem; top:50%; transform: translateY(-50%); background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:.2rem .45rem; cursor:pointer; }
.password-toggle:hover { background:#f8fafc; border-color:#d1d5db; }
.password-toggle:active { transform: translateY(-50%) scale(0.98); }

.form-options { display:flex; align-items:center; justify-content: space-between; gap:.75rem; margin-bottom: .5rem; }
.forgot-password { font-size:.85rem; color: var(--primary-color, #3b82f6); text-decoration:none; }
.forgot-password:hover { text-decoration: underline; }

.btn-login { width:100%; background: linear-gradient(135deg, #3b82f6, #2563eb); color:#fff; border:none; padding:.8rem 1rem; border-radius:12px; font-weight:700; cursor:pointer; position:relative; display:inline-flex; align-items:center; justify-content:center; }
.btn-login:disabled { opacity:.6; cursor:not-allowed; }
.btn-login .loading { display:none; align-items:center; gap:.5rem; font-weight:600; }
.btn-login .spinner { width:16px; height:16px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg);} }

/* Press and hover effects */
.btn-login:hover { filter: brightness(1.03); box-shadow: 0 8px 20px rgba(37,99,235,.35); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(37,99,235,.25); }

.login-footer { text-align:center; margin-top: .25rem; color:#6b7280; font-size:.85rem; }
body.auth-page .login-footer { opacity:.9; }
body.auth-page .logo-img { box-shadow: 0 4px 16px rgba(0,0,0,.06); }

/* Alerts on auth pages */
body.auth-page .alert { margin: .75rem 0; border-radius: 12px; padding: .75rem 1rem; font-weight:600; }
body.auth-page .alert-success { background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
body.auth-page .alert-error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }

/* Logout page reuse container */
body.logout-page .logout-container { max-width: none; }
body.logout-page h1 { margin: .5rem 0 1rem; text-align:center; font-weight:800; color:#111827; }
body.logout-page .message { background:#ecfdf5; border:1px solid #10b981; color:#065f46; border-radius:12px; padding:1rem; margin: 1rem 0; }
body.logout-page .btn { background: var(--primary-color, #3b82f6); color:#fff; border:none; padding:.65rem 1rem; border-radius:10px; font-weight:600; text-decoration:none; display:inline-flex; align-items:center; gap:.35rem; }
body.logout-page .btn.btn-secondary { background:#4b5563; }
body.logout-page .btn:hover { filter: brightness(1.03); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
body.logout-page .message { box-shadow: 0 6px 20px rgba(16,185,129,.15); }

/* Auth landing (index when not logged) */
.auth-landing-card .login-btn { background: linear-gradient(135deg, #3b82f6, #2563eb); color:#fff; border:none; padding:.8rem 1rem; border-radius:12px; font-weight:700; text-decoration:none; display:inline-flex; align-items:center; gap:.5rem; }
.auth-landing-card .subtitle { color:#64748b; margin:.35rem 0 1rem; }
.auth-landing-card .logo { font-weight:800; color:#3b82f6; }

@media (max-width: 640px) {
  .logo-img { width: 180px; height: 68px; }
  .auth-container, .login-container, .logout-container, .auth-landing-card { padding: 1.25rem; }
}

/* Global frame/footer spacing uniforme: 3rem su tutte le pagine */
.page-container { padding-bottom: 3rem !important; }
.container > *:last-child { margin-bottom: 0 !important; }

/* Assicurare spazio extra nelle pagine lunghe: Scadenze, Contabilità, Centro Notifiche */
body.contabilita-page .page-container,
body[class*="contabilita"] .page-container,
body[class*="scadenze"] .page-container,
body[class*="notifiche"] .page-container { padding-bottom: 3rem !important; }
body.contabilita-page .table-responsive,
body[class*="contabilita"] .table-responsive,
body[class*="scadenze"] .table-responsive,
body[class*="notifiche"] .table-responsive { padding-bottom: .75rem !important; }

/* Contabilità: form pagamento generico super-compatto */
body.contabilita-page #form-pagamento-generico .form-row { gap: .5rem; margin-bottom: .5rem; }
body.contabilita-page #form-pagamento-generico .form-group { margin-bottom: .4rem; }
body.contabilita-page #form-pagamento-generico .form-group label { margin-bottom: .15rem; font-size: .8rem; }
body.contabilita-page #form-pagamento-generico input,
body.contabilita-page #form-pagamento-generico select { padding: .45rem .6rem; font-size: .85rem; }

/* Contabilità: autocomplete anagrafica - allow dropdown to overflow form container */
body.contabilita-page #form-pagamento-generico,
body.contabilita-page #form-pagamento-generico .form-row,
body.contabilita-page #form-pagamento-generico .form-group {
  overflow: visible;
}
body.contabilita-page #fornitore_sugg { position: relative; overflow: visible; }
body.contabilita-page #fornitore_sugg > div { max-height: 260px; overflow-y: auto; }
body.contabilita-page #fornitore_sugg > div > div:hover { background: #f8fafc; }

/* ============================================
   SISTEMA DI GESTIONE ASSOCIAZIONE - STILE MINIMAL
   ============================================ */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global typography smaller across the app */
html, body { font-size: 13px; }
body { line-height: 1.35; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
h4 { font-size: 0.9rem; }
p, label, input, select, textarea, button { font-size: 0.85rem; }

/* Global form spacing (base defaults) */
form { margin: 0; }
.form-row { gap: .5rem; margin-bottom: .75rem; }
.form-group { margin-bottom: .6rem; }
.form-group:last-child { margin-bottom: 0; }
input, select, textarea { margin: 0; }

/* Global insertion form containers */
.form-container { padding: .75rem 1rem; margin: 0 0 .75rem 0; }

/* Checkbox list as compact pills (used in Corsi -> Istruttori) */
.checkbox-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.checkbox-item { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .6rem; border: 1px solid var(--border-color); border-radius: 999px; background: #fff; cursor: pointer; user-select: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.checkbox-item:hover { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.checkbox-item input[type="checkbox"] { width: 14px; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; border: 1.5px solid var(--border-color); border-radius: 4px; position: relative; background: #fff; }
.checkbox-item input[type="checkbox"]:checked { background: var(--primary-color); border-color: var(--primary-color); }
.checkbox-item input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 3px; top: 1px; width: 4px; height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }

/* Highlighted selection rows and callouts */
.highlight-box { background:#f8fafc; border-left:4px solid var(--primary-color); border-radius:8px; padding:1rem; margin-bottom:1.25rem; }
.form-row.highlight-box { gap:1rem; }

.callout { border-radius:8px; padding:1rem; }
.callout-amber { background:#fef3c7; border-left:4px solid #f59e0b; }

/* Section separators with colored top borders */
.section-sep { margin-top:2rem; padding-top:1.5rem; border-top-width:2px; border-top-style:solid; }
.sep-primary { border-top-color: var(--primary-color); }
.sep-purple { border-top-color: #8b5cf6; }
.sep-amber  { border-top-color: #f59e0b; }
.sep-green  { border-top-color: #10b981; }

/* Soci dashboard: ensure add-socio form has proper outer/inner spacing */
#form-aggiungi { margin: 1rem 0 1.5rem; }
#form-aggiungi > h3 { margin-bottom: .75rem; }
#form-aggiungi > form { margin-top: .5rem; }
#form-aggiungi .form-container { margin: .75rem 0 1rem; padding: 1rem 1.25rem; }

/* Istruttori dashboard: add/edit forms */
body.istruttori-dashboard #form-aggiungi,
body.istruttori-dashboard #form-modifica { margin: 1rem 0 1.5rem; }
body.istruttori-dashboard #form-aggiungi > h3,
body.istruttori-dashboard #form-modifica > h3 { margin-bottom: .75rem; }
body.istruttori-dashboard #form-aggiungi > form,
body.istruttori-dashboard #form-modifica > form { margin-top: .5rem; }

/* Corsi dashboard: add/edit forms */
body.corsi-dashboard #form-aggiungi,
body.corsi-dashboard #form-modifica { margin: 1rem 0 1.5rem; }
body.corsi-dashboard #form-aggiungi > h3,
body.corsi-dashboard #form-modifica > h3 { margin-bottom: .75rem; }
body.corsi-dashboard #form-aggiungi > form,
body.corsi-dashboard #form-modifica > form { margin-top: .5rem; }

/* Contabilità: pagamento generico form block */
body.contabilita-page #form-pagamento-generico { margin: 1rem 0 1.5rem; }

/* Dashboards: keep insertion forms readable and not too wide */
body.soci-dashboard .form-container,
body.istruttori-dashboard .form-container,
body.corsi-dashboard .form-container,
body.contabilita-page .form-container {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 1280px) {
  body.soci-dashboard .form-container,
  body.istruttori-dashboard .form-container,
  body.corsi-dashboard .form-container,
  body.contabilita-page .form-container { max-width: 1000px; }
}

/* Compact buttons text globally unless overridden */
.btn { font-size: 0.8rem; }

/* Utilities */
.d-none { display: none; }

/* Page header actions: minimal and compact */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}
.header-actions h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.header-actions .actions { display:flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; align-items: flex-end; }
.header-actions .filters-inline { display:flex; align-items: flex-end; gap:.5rem; flex-wrap: wrap; }
.header-actions .actions > .btn { align-self: flex-end; }

/* Compact controls inside header actions */
.header-actions label { font-size: .7rem; color: var(--text-secondary); font-weight: 600; margin: 0; }
.header-actions input,
.header-actions select { height: 32px; padding: 0 .6rem; font-size: .8rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: #fff; line-height: 1.2; }
.header-actions .btn { height: 32px; padding: 0 .6rem; font-size: .75rem; }
.header-actions .form-group { display:flex; align-items: center; gap: .35rem; margin: 0; }

/* Global placeholders: light gray for better readability */
input::placeholder, textarea::placeholder { color: var(--gray-400); opacity: 1; }
/* Vendor prefixes for broader support */
::-webkit-input-placeholder { color: var(--gray-400); opacity: 1; }
::-moz-placeholder { color: var(--gray-400); opacity: 1; }
:-ms-input-placeholder { color: var(--gray-400); opacity: 1; }
:-moz-placeholder { color: var(--gray-400); opacity: 1; }
/* Autofill text color */
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { -webkit-text-fill-color: #000; }

/* Minimal filters: compact inputs and labels */
.filters { background: transparent; border: none; box-shadow: none; padding: 0.25rem 0; margin-bottom: 0.35rem; }
.filters-inline { display:flex; gap:.5rem; align-items:center; flex-wrap: wrap; }
.filter-group, .filter-group-inline { display:flex; align-items: center; gap: .35rem; }
.filters .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem; align-items: end; }
.filters .form-group { display:flex; flex-direction: column; gap:.25rem; margin:0; }
.filters .form-group label { font-size: .7rem; font-weight:600; color: var(--text-secondary); margin:0; }
.filters input, .filters select { height: 32px; padding: 0 .6rem; font-size: .8rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: #fff; line-height: 1.2; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.filters .btn { height: 32px; padding: 0 .6rem; font-size: .75rem; }

/* ============================================
   Tables: notifications and lists
   ============================================ */
.movimenti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: #fff;
}
.movimenti-table thead { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); }
.movimenti-table th {
  padding: 0.6rem 0.4rem;
  text-align: left;
  color: #fff;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  position: sticky; top: 0; z-index: 1;
}
.movimenti-table th, .movimenti-table td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border-color); text-align: left; }
.movimenti-table tbody tr { background-color: #fff; }
.movimenti-table tbody tr:nth-child(even) { background-color: #fff; }
.movimenti-table tbody tr:hover { background-color: var(--primary-light, #eef2ff); }

/* Pagination */
.pagination-info { display: block; margin-bottom: .5rem; color: var(--text-secondary); font-size: .8rem; }
.pagination-controls { display:flex; justify-content:center; align-items:center; gap: 0.5rem; margin-top: .5rem; flex-wrap: wrap; }

/* Status badges (notifiche) */
.status-badge { padding: 0.25rem 0.75rem; border-radius: var(--border-radius-sm); font-size: 0.7rem; font-weight: 600; }
.status-valido { background: #d1fae5; color: #10b981; }
.status-scadenza { background: #fef3c7; color: #f59e0b; }
.status-scaduto { background: #fee2e2; color: #ef4444; }
.status-senza { background: var(--gray-100); color: var(--gray-600); }
.socio-attivo { background: #10b981; color:#fff; border: 1px solid #059669; padding: 0.1rem 0.4rem; border-radius: var(--border-radius-sm); }
.socio-inattivo { background: #ef4444; color:#fff; border: 1px solid #dc2626; padding: 0.1rem 0.4rem; border-radius: var(--border-radius-sm); }

/* Email form (notifiche) */
.email-form-section { background: #fff; border-radius: var(--border-radius); padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: none; border: none; }
.email-form-container { max-width: none; margin: 0; }
.email-form-container h3 { border-bottom: 2px solid var(--primary-color); padding-bottom: 0.5rem; }

/* Action menu (notifiche) */
.action-menu-container { position: relative; display: inline-block; }
.action-menu-btn { background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: var(--border-radius-sm); width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: var(--gray-700); transition: all 0.2s ease; display:flex; align-items:center; justify-content:center; }
.action-menu-btn:hover { background: var(--gray-200); border-color: var(--gray-400); transform: scale(1.05); }
.action-dropdown { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) translateY(-20px); background: #fff; border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: 0 10px 25px rgba(0,0,0,0.2); min-width: 280px; max-width: 90vw; z-index: 9999; opacity: 0; visibility: hidden; transition: all .3s ease; }
.action-dropdown.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) translateY(0); }
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998; opacity: 0; visibility: hidden; transition: all .3s ease; }
.popup-overlay.show { opacity: 1; visibility: visible; }
.action-group { padding: 0.5rem; border-bottom: 1px solid var(--gray-100); }
.action-group:last-child { border-bottom: none; }
.action-group-title { font-size: .7rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 0.5rem; padding: 0 0.5rem; }
.action-btn { width: 100%; padding: 0.5rem 0.75rem; border: none; background: transparent; text-align: left; cursor: pointer; font-size: .8rem; color: var(--gray-700); border-radius: var(--border-radius-sm); transition: all .2s ease; display:flex; align-items:center; gap:.5rem; }
.action-btn:hover { background: var(--primary-light, #eef2ff); color: var(--primary-color); }
.action-btn.whatsapp:hover { background: #25d366; color: #fff; }

/* ============================================
   Utilities: soft highlights for detail pages
   ============================================ */
.input-soft-warning { background:#fffbeb !important; color:#92400e !important; font-weight:600; }
.input-soft-danger  { background:#fef2f2 !important; color:#dc2626 !important; font-weight:600; }
.input-soft-info    { background:#e0f2fe !important; color:#0277bd !important; font-weight:600; }
.text-success-strong { color:#059669 !important; font-weight:600; }
.text-danger-strong  { color:#dc2626 !important; font-weight:600; }
.fw-600 { font-weight: 600 !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-sm { font-size: .8rem !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-025 { margin-top: .25rem !important; }
.mb-1 { margin-bottom: 1rem !important; }
.block { display: block !important; }
.flex-center-gap { display:flex !important; gap:1rem !important; justify-content:center !important; }
.section-divider { margin-top: 2rem !important; padding-top: 1.5rem !important; border-top: 2px solid var(--primary-color) !important; }
.box-muted { background:#f8fafc !important; padding:1rem !important; border-radius:8px !important; }
.input-soft-muted { background:#f3f4f6 !important; color:#6b7280 !important; font-weight:600 !important; }
/* Visibility helpers */
.d-none { display: none; }
.d-block { display: block; }

/* ============================================
   Collapsible Info Cards (dettagli pages)
   ============================================ */
.info-cards-container { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap:1rem; margin-bottom: 1.5rem; }
.info-card { background:#fff; border-radius: var(--border-radius); border:1px solid var(--border-color); box-shadow: var(--shadow-sm); overflow:hidden; transition: box-shadow .2s ease, transform .2s ease; cursor: pointer; }
.info-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.info-card.expanded { grid-column: 1 / -1; box-shadow: var(--shadow-md); }
.info-card-header { padding:1rem; background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); border-bottom:1px solid var(--border-color); display:flex; align-items:center; justify-content:space-between; }
.info-card-title { margin:0; font-weight:600; color: var(--gray-800); display:flex; align-items:center; gap:.5rem; }
.info-card-content { padding:0; max-height:0; opacity:0; overflow:hidden; transition: all .25s ease; background:#fff; }
.info-card.expanded .info-card-content { padding:1rem; max-height:2000px; opacity:1; }
.info-card-toggle { padding:.4rem .75rem; border:none; border-radius: var(--border-radius-sm); background: var(--info-color); color:#fff; font-size:.8rem; cursor:pointer; }
.info-card.collapsed .info-card-toggle { background: var(--primary-color); }
.info-card-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: .75rem; }

/* ============================================
   Economic Stats Cards (dettagli socio/istruttore)
   ============================================ */
.stats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-card { position:relative; padding:1rem; border-radius:12px; color:#0f172a; border:1px solid var(--border-color); box-shadow: var(--shadow-sm); overflow:hidden; }
.stat-card .stat-value { font-size:1.4rem; font-weight:700; line-height:1.2; }
.stat-card .stat-label { margin-top:.35rem; font-size:.85rem; color: var(--text-secondary); font-weight:500; }

/* Tier backgrounds */
.stat-card.stat-tier-1 { background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%); border-color:#a7f3d0; }
.stat-card.stat-tier-2 { background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); border-color:#bfdbfe; }
.stat-card.stat-tier-3 { background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%); border-color:#fcd34d; }
.stat-card.stat-tier-4 { background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%); border-color:#fca5a5; }

/* Legend styles */
.stats-legend { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:.75rem; color: var(--text-secondary); }
.legend-item { display:flex; align-items:center; gap:.4rem; font-size:.85rem; }
.legend-dot { width:10px; height:10px; border-radius:999px; display:inline-block; }
.legend-dot.stat-tier-1 { background:#10b981; }
.legend-dot.stat-tier-2 { background:#3b82f6; }
.legend-dot.stat-tier-3 { background:#f59e0b; }
.legend-dot.stat-tier-4 { background:#ef4444; }

/* Clickable deadline cards: more compact, left-aligned layout (Index only for specificity) */
.clickable { cursor: pointer; }
body.index-page .stat-card.clickable { transition: transform .2s ease, box-shadow .2s ease; text-align:left; display:flex; align-items:center; gap:.9rem; padding:1rem 1.25rem; border-radius:12px; }
body.index-page .stats-grid .stat-icon { font-size:1.4rem; margin-bottom:0; }
body.index-page .stats-grid .stat-value { font-size:1.4rem; font-weight:700; line-height:1.1; }
body.index-page .stats-grid .stat-label { font-size:.82rem; text-transform:none; letter-spacing:.02em; }
body.index-page .stat-card.stat-deadline-pay { background:#ffffff !important; border-color:#bfdbfe !important; }
body.index-page .stat-card.stat-deadline-cert { background:#ffffff !important; border-color:#a7f3d0 !important; }
body.index-page .stat-card.stat-deadline-ass { background:#ffffff !important; border-color:#fed7aa !important; }
body.index-page .stat-card.stat-deadline-bday { background:#ffffff !important; border-color:#fecaca !important; }
body.index-page .stat-card.stat-deadline-custom { background:#ffffff !important; border-color:#e5e7eb !important; }
body.index-page .stat-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Table note compact helper */
.nota-breve { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:260px; display:inline-block; vertical-align:bottom; }

@media (max-width: 640px) {
  .stat-card .stat-value { font-size:1.15rem; }
  .stat-card { padding:.85rem; }
  .nota-breve { max-width: 160px; }
}
.info-card-item { display:flex; flex-direction:column; }
.info-card-item label { font-size:.75rem; color: var(--text-secondary); margin-bottom:.25rem; font-weight:600; text-transform: uppercase; letter-spacing:.03em; }

@media (max-width: 768px) {
  .info-cards-container { grid-template-columns: 1fr; }
}

/* ============================================
   Generic Stats (situazione economica)
   ============================================ */
.stats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:1rem; margin-bottom:1rem; }
.stat-card { background:#fff; border:1px solid var(--border-color); border-radius: var(--border-radius); padding:1rem; text-align:center; box-shadow: var(--shadow-sm); }
.stat-value { font-size:1.5rem; font-weight:800; line-height:1; margin-bottom:.25rem; }
.stat-label { font-size:.8rem; color: var(--text-secondary); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }

/* Economic tiers for Totale Guadagnato */
.stat-card.stat-tier-1 { border-left: 4px solid #16a34a; background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%); }
.stat-card.stat-tier-1 .stat-value { color: #16a34a; }
.stat-card.stat-tier-2 { border-left: 4px solid #f59e0b; background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%); }
.stat-card.stat-tier-2 .stat-value { color: #f59e0b; }
.stat-card.stat-tier-3 { border-left: 4px solid #2563eb; background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%); }
.stat-card.stat-tier-3 .stat-value { color: #2563eb; }
.stat-card.stat-tier-4 { border-left: 4px solid #7c3aed; background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%); }
.stat-card.stat-tier-4 .stat-value { color: #7c3aed; }

/* Legend for economic tiers */
.stats-legend { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; margin-top:.5rem; }
.legend-item { display:inline-flex; align-items:center; gap:.35rem; font-size:.8rem; color: var(--text-secondary); }
.legend-dot { width:10px; height:10px; border-radius:9999px; display:inline-block; }
.legend-dot.stat-tier-1 { background:#16a34a; }
.legend-dot.stat-tier-2 { background:#f59e0b; }
.legend-dot.stat-tier-3 { background:#2563eb; }
.legend-dot.stat-tier-4 { background:#7c3aed; }

/* Instructor courses cards */
.corsi-section h4 { margin: 1rem 0; font-weight: 700; color: var(--text-primary); display:flex; align-items:center; gap:.5rem; }
.corsi-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.corso-card { background:#fff; border:1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); overflow:hidden; transition: var(--transition); }
.corso-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.corso-header { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); padding:.75rem 1rem; font-weight:700; color: var(--text-primary); border-bottom:1px solid var(--border-color); }
.corso-stats { display:flex; justify-content: space-between; align-items:center; padding:.75rem 1rem; gap: .75rem; }
.corso-stat { display:flex; flex-direction:column; text-align:center; }
.corso-number { font-weight:800; color: var(--primary-color); font-size:1.1rem; line-height:1; }
.corso-label { font-size:.75rem; color: var(--text-secondary); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.corso-incasso { font-size:.85rem; font-weight:700; color: var(--success-color); }

/* Inline search: compact and consistent with filters */
.search-inline { display: flex; align-items: center; gap: .5rem; }
.search-input-container-inline { display: flex; align-items: center; gap: .35rem; }
.search-input-long {
  height: 32px;
  padding: 0 .6rem;
  font-size: .8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #fff;
  line-height: 1.2;
  width: 320px;
  max-width: 100%;
}
.search-inline .btn { height: 32px; padding: 0 .6rem; font-size: .75rem; }

/* ============================================
   Compact typography for dettagli/modifica pages
   ============================================ */
.soci-dashboard, .istruttori-dashboard {
  font-size: 13px;
}
.soci-dashboard h2, .istruttori-dashboard h2 { font-size: 1rem; }
.soci-dashboard h3, .istruttori-dashboard h3 { font-size: 0.95rem; }
.soci-dashboard h4, .istruttori-dashboard h4 { font-size: 0.9rem; }
.soci-dashboard .form-group label, .istruttori-dashboard .form-group label { font-size: 0.75rem; }
.soci-dashboard input, .soci-dashboard select, .soci-dashboard textarea,
.istruttori-dashboard input, .istruttori-dashboard select, .istruttori-dashboard textarea {
  font-size: 0.8rem;
}
.soci-dashboard table, .istruttori-dashboard table { font-size: 0.8rem; }
.soci-dashboard .stat-value, .istruttori-dashboard .stat-value { font-size: 1.25rem; }
.soci-dashboard .stat-label, .istruttori-dashboard .stat-label { font-size: 0.7rem; }

@media (max-width: 768px) {
  .header-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .header-actions .actions { justify-content: center; }
  .filters .form-row { grid-template-columns: 1fr; }
  .filters-inline { justify-content: center; }
  .search-inline { width: 100%; flex: 1; }
  .search-input-container-inline { width: 100%; flex: 1; }
  .search-input-long { width: 100%; }
}

/* Global mobile typography: make text more compact on very small screens */
@media (max-width: 480px) {
  body { font-size: 12px; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1rem; }
  h3 { font-size: 0.95rem; }
  h4 { font-size: 0.9rem; }
  table { font-size: 0.75rem; }
  th { font-size: 0.7rem; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.65rem; }
  .btn { font-size: 0.7rem; padding: 0.5rem 0.75rem; }
  /* Keep form field font-size to prevent mobile zoom issues */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  select,
  textarea { font-size: 16px; }
}

/* ============================================
   INDEX PAGE (Dashboard) - namespaced
   ============================================ */
body.index-page {
  background: var(--gray-50);
  color: var(--gray-800);
}

/* Header */
body.index-page .main-header { background: white; border-bottom: 1px solid var(--gray-200); padding: 0 2rem; height: 70px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
body.index-page .header-left { display:flex; align-items:center; gap:1rem; flex:1; min-width:0; }
body.index-page .header-center { flex:2; display:flex; justify-content:center; }
body.index-page .header-search { position: relative; width: 100%; max-width: 520px; }
body.index-page .header-search input {
  width: 100%; height: 36px; padding: 0 .75rem; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: .875rem; background: #f1f5f9; color: #000;
}
body.index-page .header-search input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
body.index-page .search-dropdown { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 1100; overflow: hidden; }
body.index-page .search-item { display:flex; align-items:center; gap:.5rem; padding:.5rem .75rem; cursor: pointer; font-size:.875rem; color: #000; }
body.index-page .search-item:hover { background: #f8fafc; }
body.index-page .search-empty { padding:.6rem .75rem; color: var(--gray-500); font-size:.8rem; }
body.index-page .menu-btn { background:none; border:none; width:40px; height:40px; border-radius:8px; color:var(--gray-600); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:.2s; z-index: 1000; }
body.index-page .menu-btn:hover { background:var(--gray-100); color:var(--primary-color); }
@media (max-width: 768px) {
  body.index-page .menu-btn { color: #000; background: #f1f5f9; border: 1px solid #e2e8f0; }
  body.index-page .menu-btn:hover { background: #e2e8f0; color: #000; }
}
body.index-page .logo { font-size:1.5rem; font-weight:700; color:var(--primary-color); text-decoration:none; }
body.index-page .header-right { display:flex; align-items:center; gap:1rem; }
/* Hide search toggle on desktop */
.search-toggle-btn { display: none; }
body.index-page .logout-btn { background: var(--danger-color); color:#fff; border:none; padding:.5rem 1rem; border-radius:8px; cursor:pointer; text-decoration:none; font-weight:500; font-size:.875rem; transition:.2s; display:inline-flex; align-items:center; gap:.5rem; }
body.index-page .logout-btn:hover { background:#dc2626; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Sidebar */
body.index-page .sidebar { position:fixed; left:0; top:0; width:280px; height:100vh; background:#fff; border-right:1px solid var(--gray-200); overflow-y:auto; z-index:1000; transition: transform .3s ease; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
body.index-page .sidebar-header { padding:2rem 1.5rem; border-bottom:1px solid var(--gray-200); background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%); color:#fff; }
body.index-page .sidebar-logo-container { display:flex; flex-direction:column; align-items:center; gap:.75rem; margin-bottom:1.5rem; }
body.index-page .sidebar-logo-img { width:60px; height:60px; object-fit:contain; border-radius:12px; background: rgba(255,255,255,.1); padding:.5rem; backdrop-filter: blur(10px); }
body.index-page .sidebar-logo-text { font-size:1.25rem; font-weight:700; text-align:center; line-height:1.2; }
body.index-page .sidebar-user { background: rgba(255,255,255,.1); border-radius:12px; padding:1rem; text-align:center; cursor:pointer; transition:.2s; backdrop-filter: blur(10px); }
body.index-page .sidebar-user:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
body.index-page .sidebar-user-name { font-weight:600; font-size:.875rem; margin-bottom:.25rem; }
body.index-page .sidebar-user-role { font-size:.75rem; opacity:.9; }
body.index-page .nav-section { margin-bottom:2rem; }
body.index-page .nav-section-title { padding:0 1.5rem; font-size:.75rem; font-weight:600; text-transform:uppercase; color:var(--gray-500); margin-bottom:.75rem; letter-spacing:.05em; }
body.index-page .nav-item { margin:.25rem .5rem; }
body.index-page .nav-link { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem; color:var(--gray-700); text-decoration:none; border-radius:8px; transition:.2s; font-weight:500; position:relative; }
body.index-page .nav-link:hover { background:var(--gray-100); color:var(--primary-color); }
body.index-page .nav-link.active { background: var(--primary-light); color: var(--primary-color); font-weight:600; }
body.index-page .nav-link.active::before { content:''; position:absolute; left:0; top:50%; transform: translateY(-50%); width:3px; height:24px; background: var(--primary-color); border-radius:0 2px 2px 0; }
body.index-page .nav-icon { width:20px; height:20px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }

/* Content */
body.index-page .main-content { margin-left:280px; padding:2rem; min-height:100vh; background: var(--gray-50); }
/* Avoid footer overlap */
body.index-page .main-content { padding-bottom: 1px; }
body.index-page .content-header { margin-bottom:2rem; background:#fff; padding:2rem; border-radius:16px; box-shadow: var(--shadow-sm); border:1px solid var(--gray-200); }
body.index-page .content-title { font-size:1.875rem; font-weight:700; color:var(--gray-900); margin-bottom:.5rem; display:flex; align-items:center; gap:1rem; }
body.index-page .content-subtitle { color:var(--gray-600); font-size:1.125rem; }

/* Dashboard cards */
body.index-page .dashboard-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap:1.5rem; margin-bottom:2rem; }
body.index-page .dashboard-card { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); border-radius:16px; padding:2rem; box-shadow: var(--shadow-sm); border:1px solid var(--gray-200); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; position:relative; overflow:hidden; }
body.index-page .dashboard-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background: linear-gradient(90deg, var(--primary-color), var(--info-color)); }
body.index-page .dashboard-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px) scale(1.01); border-color: var(--primary-light); }
body.index-page .dashboard-card h3 { font-size:1.25rem; font-weight:600; color:var(--gray-900); margin-bottom:1rem; display:flex; align-items:center; gap:.5rem; }
body.index-page .dashboard-card p { color:var(--gray-600); line-height:1.7; margin-bottom:1.5rem; }
body.index-page .dashboard-card .btn { background: var(--primary-color); color: #fff; }
body.index-page .dashboard-card .btn:hover { background: var(--primary-color); }
/* Optional ghost/secondary buttons on index */
.btn-ghost { background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: #e2e8f0; }

/* Buttons */
body.index-page .btn { background: var(--primary-color); color:#fff; border:none; padding:.75rem 1.5rem; border-radius:8px; cursor:pointer; font-weight:500; font-size:.875rem; transition:.2s; text-decoration:none; display:inline-flex; align-items:center; gap:.5rem; }
body.index-page .btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
body.index-page .btn-outline-primary { background:transparent; color: var(--primary-color); border:2px solid var(--primary-color); }
body.index-page .btn-outline-primary:hover { background: var(--primary-color); color:#fff; }

/* Stats cards */
body.index-page .stats-container { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:1.5rem; margin-bottom:2.25rem; }
body.index-page .stat-card { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); padding:1.35rem; border-radius:14px; text-align:center; box-shadow: var(--shadow-sm); border:1px solid var(--gray-200); position:relative; overflow:hidden; transition: transform .2s ease, box-shadow .2s ease; }
body.index-page .stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: var(--primary-color); }
body.index-page .stat-number { font-size:2.4rem; font-weight:800; color:var(--gray-900); margin-bottom:.45rem; line-height:1; }
body.index-page .stat-label { font-size:.9rem; color:var(--gray-600); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
body.index-page .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* Icon inside stat cards */
body.index-page .stat-card .stat-icon { font-size:1.5rem; margin-bottom:.25rem; }

/* Spazio dedicato + separatore tra le statistiche e le cards di scadenze */
body.index-page .stats-grid {
  margin-top: 1.25rem;
  margin-bottom: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap:1.5rem;
}

@media (max-width: 640px) {
  body.index-page .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.index-page .stats-container {
    grid-template-columns: 1fr;
  }
}

/* Grayscale separators and subtle hover for professionalism */
body.index-page .content-header { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
body.index-page .nav-link:hover { background: #f8fafc; color: var(--primary-color); }

/* Page embed */
body.index-page .page-container { background:#fff; border-radius:16px; box-shadow: var(--shadow); border:1px solid var(--gray-200); overflow:hidden; margin-top:2rem; margin-bottom: 0; }
body.index-page .page-header { padding:1.5rem 2rem; border-bottom:1px solid var(--gray-200); background: var(--gray-50); }
body.index-page .page-body { height: calc(100vh - 200px); overflow:hidden; }
body.index-page .page-iframe { width:100%; height:100%; border:none; display:block; }

/* Disable outer scroll when a frame page is open */
body.index-page.frame-open { overflow: hidden; }

/* Global Loader Overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loader-box { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 1rem 1.25rem; box-shadow: var(--shadow-md); width: min(420px, 92vw); }
.loader-spinner {
  width: 28px; height: 28px; border: 3px solid #e5e7eb; border-top-color: var(--primary-color); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto .5rem auto;
}
.loader-text { text-align: center; color: var(--text-primary); font-weight: 700; margin-bottom: .5rem; }
.loader-progress { width: 100%; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; border: 1px solid var(--gray-200); }
.loader-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary-color), #60a5fa); width: 0%; transition: width .2s ease; }
@keyframes spin { to { transform: rotate(360deg);} }

/* Wide screens: use full available width and baseline 1600px layout */
@media (min-width: 1600px) {
  /* Index: stretch content to fill space next to sidebar */
  body.index-page .main-content { max-width: none; width: calc(100vw - 280px); }
  /* Make inner sections fluid (remove any implicit caps) */
  body.index-page .content-header,
  body.index-page .stats-container,
  body.index-page .charts-section,
  body.index-page .dashboard-grid,
  body.index-page .page-container { max-width: none; }
  /* Contabilità: contenitore fluido oltre 1600px (senza gutters laterali) */
  body.contabilita-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }
  body.contabilita-page .container > .header-actions,
  body.contabilita-page .container > .stats-grid,
  body.contabilita-page .container > .filters,
  body.contabilita-page .container > .movimenti-list { margin-left: 0; margin-right: 0; max-width: none; width: 100%; }
  /* Pagamenti: contenitore fluido oltre 1600px (senza gutters laterali) */
  body.pagamenti-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }
  body.pagamenti-page .container > .header-actions,
  body.pagamenti-page .container > .filters,
  body.pagamenti-page .container > .pagamenti-list { margin-left: 0; margin-right: 0; max-width: none; width: 100%; }
  /* Statistiche: contenitore fluido oltre 1600px (senza gutters laterali) */
  body.statistiche-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }
  body.statistiche-page .container > .page-container { margin-left: 0; margin-right: 0; max-width: none; width: 100%; }
}

/* Other pages: center big containers up to 1600px */
.container { max-width: 1600px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
/* Pagamenti: full-bleed su tutte le larghezze e componenti interni compatti */
body.pagamenti-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
body.pagamenti-page .header-actions { padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
body.pagamenti-page .form-container.filters { padding: 1rem 1.5rem; margin-bottom: 1rem; }
body.pagamenti-page .form-container.filters h3 { margin-bottom: .75rem; }
body.pagamenti-page .form-container.filters form { width: 100%; }
body.pagamenti-page .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 0; align-items: end; }
body.pagamenti-page .form-group { margin-bottom: .5rem; }
body.pagamenti-page .form-group label { margin-bottom: .25rem; font-size: .9rem; }
body.pagamenti-page select,
body.pagamenti-page input,
body.pagamenti-page textarea { padding: .5rem .75rem; font-size: .9rem; }

body.pagamenti-page select,
body.pagamenti-page input,
body.pagamenti-page textarea {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 0 rgba(15,23,42,0.03);
}
body.pagamenti-page select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
body.pagamenti-page select:focus,
body.pagamenti-page input:focus,
body.pagamenti-page textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
body.pagamenti-page .filter-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: .1rem; grid-column: 1 / -1; }
body.pagamenti-page .filter-actions .btn { width: auto; }

/* Contabilità: filtri con lo stesso look dei pagamenti */
body.contabilita-page .form-container.filters form { width: 100%; }
body.contabilita-page .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 0; align-items: end; }
body.contabilita-page select,
body.contabilita-page input,
body.contabilita-page textarea {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 0 rgba(15,23,42,0.03);
}
body.contabilita-page select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
body.contabilita-page select:focus,
body.contabilita-page input:focus,
body.contabilita-page textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
/* Tabella pagamenti: caratteri più piccoli e densi */
body.pagamenti-page .movimenti-table { font-size: .8rem; }
body.pagamenti-page .movimenti-table thead th { font-size: .7rem; padding-top: .4rem; padding-bottom: .4rem; }
body.pagamenti-page .movimenti-table td { padding-top: .4rem; padding-bottom: .4rem; }
/* Paginazione pagamenti: spaziatura e allineamento */
body.pagamenti-page .pagination-info { margin-top: .5rem; color: var(--gray-600); font-size: .9rem; }
body.pagamenti-page .pagination-controls { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .75rem 0 1rem; flex-wrap: wrap; }
/* Statistiche: full-bleed e padding compatti */
body.statistiche-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
body.statistiche-page .page-container { padding: 1.25rem 1.5rem; }
body.statistiche-page .header-actions { padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
body.statistiche-page .form-container { padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
body.statistiche-page .stats-grid { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
body.statistiche-page .stat-card { padding: 1rem; }
body.statistiche-page .stat-card h3 { font-size: 1rem; margin-bottom: .35rem; }
body.statistiche-page .stat-number { font-size: 1.6rem; }
body.statistiche-page .stat-label { font-size: .75rem; }
/* Bottoni compatti nelle colonne Socio/Stato della tabella pagamenti */
body.pagamenti-page .movimenti-table .btn-table { font-size: .65rem !important; padding: .15rem .35rem !important; line-height: 1.1; border-radius: 6px; }
body.pagamenti-page .movimenti-table .btn.btn-small { font-size: .65rem; padding: .2rem .4rem; }
/* Contabilità: full-bleed su tutte le larghezze */
body.contabilita-page .container { max-width: none; width: 100%; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }

/* Soft gradient variants for top stats */
body.index-page .stats-container .stat-card:nth-child(1) { background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 100%); border-color:#a7f3d0; }
body.index-page .stats-container .stat-card:nth-child(2) { background: linear-gradient(180deg, #eff6ff 0%, #eef2ff 100%); border-color:#bfdbfe; }
body.index-page .stats-container .stat-card:nth-child(3) { background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%); border-color:#ddd6fe; }
body.index-page .stats-container .stat-card:nth-child(4) { background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); border-color:#fde68a; }

/* Fade-in animation */
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}
body.index-page .stats-container .stat-card,
body.index-page .stats-grid .stat-card,
body.index-page .dashboard-grid .dashboard-card { opacity:0; animation: fadeInUp .35s ease forwards; }
body.index-page .stats-container .stat-card:nth-child(1) { animation-delay: .05s; }
body.index-page .stats-container .stat-card:nth-child(2) { animation-delay: .1s; }
body.index-page .stats-container .stat-card:nth-child(3) { animation-delay: .15s; }
body.index-page .stats-container .stat-card:nth-child(4) { animation-delay: .2s; }
body.index-page .stats-grid .stat-card:nth-child(1) { animation-delay: .25s; }
body.index-page .stats-grid .stat-card:nth-child(2) { animation-delay: .3s; }
body.index-page .stats-grid .stat-card:nth-child(3) { animation-delay: .35s; }
body.index-page .stats-grid .stat-card:nth-child(4) { animation-delay: .4s; }
body.index-page .dashboard-grid .dashboard-card:nth-child(1) { animation-delay: .45s; }
body.index-page .dashboard-grid .dashboard-card:nth-child(2) { animation-delay: .5s; }
body.index-page .dashboard-grid .dashboard-card:nth-child(3) { animation-delay: .55s; }
body.index-page .dashboard-grid .dashboard-card:nth-child(4) { animation-delay: .6s; }

/* Footer bar */
body.index-page .footer-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--gray-700);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
body.index-page .footer-bar .footer-content { max-width: 1200px; width: 100%; text-align: center; }
@media (max-width: 768px) {
  body.index-page .main-content { padding-bottom: 88px; }
  body.index-page .footer-bar { font-size: 0.75rem; padding: 0.6rem; }
}

/* Overlay and responsive */
body.index-page .mobile-overlay { position:fixed; top:0; left:0; width:100vw; height:100vh; background: rgba(0,0,0,.5); z-index:1000; display:none; opacity:0; transition: opacity .3s ease; backdrop-filter: blur(4px); }
body.index-page .mobile-overlay.active { display:block; opacity:1; }

@media (max-width: 768px) {
  body.index-page .main-header { padding: 0 1rem; flex-wrap: wrap; }
  body.index-page .header-right { gap:.5rem; order: 2; }
  body.index-page .header-center { order: 3; width: 100%; margin-top: .5rem; }
  body.index-page .header-search { max-width: none; }
  body.index-page .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-xl); height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  body.index-page .sidebar.mobile-open { transform: translateX(0); }
  body.index-page .main-content { margin-left:0; padding:1rem; }
  body.index-page .content-header { padding:1.5rem; margin-bottom:1rem; }
  body.index-page .content-title { font-size:1.5rem; }
  body.index-page .dashboard-grid { grid-template-columns:1fr; gap:1rem; }
  body.index-page .stats-container { grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:1rem; }
  /* Mobile search reveal behavior: show within header as second row */
  body.index-page .header-center { display: none; }
  body.search-open .header-center { display: block; position: static; transform: none; width: 100%; z-index: auto; }
  .search-toggle-btn { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border:1px solid #e2e8f0; border-radius:8px; background:#f1f5f9; color:#0f172a; }
  .search-toggle-btn:hover { background:#e2e8f0; }
}

@media (max-width: 480px) {
  body.index-page .main-header { padding: 0 .75rem; }
  body.index-page .content-header { padding:1rem; }
  body.index-page .dashboard-card { padding:1.5rem; }
}

/* Mobile borderless guideline */
@media (max-width: 768px) {
  /* Rimuove bordi e ombre su container/card comuni su mobile */
  .form-container,
  .header-actions,
  .soci-list,
  .pagamenti-list,
  .filters,
  .scadenze-list,
  .corsi-list,
  .stats-section,
  .search-section,
  .filters-section,
  .asd-card,
  .settings-card,
  .dropdown-section,
  .backup-card,
  .maintenance-card,
  .table,
  .table-container,
  .page-container,
  .content-header,
  .dashboard-card,
  .corso-card,
  .stat-card,
  .summary-item,
  .socio-card,
  .association-summary,
  footer {
    border: none !important;
    box-shadow: none !important;
  }
}

/* ============================================
   CORSI PAGE (Dashboard) - namespaced
   ============================================ */
/* (removed) page-specific CORSI styles; using global classes instead */

/* ============================================
   SOCI PAGE (Dashboard) - namespaced
   ============================================ */
/* (removed) page-specific SOCI styles; using global classes instead */

/* ============================================
   ISCRIZIONI CORSI PAGE - namespaced
   ============================================ */
/* (removed) page-specific ISCRIZIONI styles; using global classes instead */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    /* Gray palette (used across pages, matches index) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    /* Backgrounds */
    --background-color: #f9fafb; /* align to index gray */
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --hover-color: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 4px 8px -2px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--background-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

/* Global desktop frame width for pages: layout full-width ma con padding laterale base */
[class$='-dashboard'],
.dashboard-container,
.page-container,
main {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Force light UI background for sections that opt-in */
.force-light-ui {
  background: var(--gray-50) !important;
}

/* Wide desktop enhancements */
@media (min-width: 1920px) {
  [class$='-dashboard'],
  .dashboard-container,
  .page-container,
  main {
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  body { font-size: 15px; }
}

@media (min-width: 2560px) {
  [class$='-dashboard'],
  .dashboard-container,
  .page-container,
  main {
    max-width: none;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  body { font-size: 16px; }
}

/* Mobile stabilization: prevent page shift and overscroll on mobile */
html, body { overscroll-behavior: none; }
body { overflow-x: hidden; touch-action: manipulation; }

/* Global UI utilities */
.card { background: var(--card-background); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); }
.card-sm { background: var(--card-background); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); box-shadow: var(--shadow-sm); }
.card-header-min { padding: .75rem 1rem; border-bottom: 1px solid var(--border-color); font-weight: 600; color: var(--text-primary); }
.card-body-min { padding: 1rem; }
.text-muted { color: var(--text-secondary); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Input affix helpers: prevent icon/+/− overlap with text */
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .affix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; font-weight: 700; }
.input-affix input { padding-left: 28px; }

/* Global badges */
.badge { display:inline-block; padding:.25rem .75rem; border-radius: var(--border-radius-sm); font-size: .7rem; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.badge-info { background: var(--info-light); color: var(--info-color); }
.badge-success { background: var(--success-light); color: var(--success-color); }
.badge-warning { background: var(--warning-light); color: var(--warning-color); }

/* Header Minimal */
header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

nav a:hover,
nav a.active {
    background-color: rgba(255,255,255,0.15);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* Dashboard Minimal */
.dashboard {
    display: grid;
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-background);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Form Container Minimal */
.form-container {
    background: var(--card-background);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.form-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: .5rem;
}

.form-group {
    margin-bottom: .5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    height: 32px;
    padding: 0 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    line-height: 1.2;
    transition: var(--transition);
    background: var(--card-background);
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Select styles removed temporarily for debugging native rendering */

/* Classic select styling within forms: visible text, full width */
.form-container select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  padding: .5rem .6rem;
  font-size: .9rem;
  border: 1.8px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #fff;
  color: #111827;
  line-height: 1.2;
  box-sizing: border-box;
}
.form-container input[type="date"],
.form-container input[type="number"],
.form-container input[type="text"],
.form-container input[type="email"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  padding: .5rem .6rem;
  font-size: .9rem;
  border: 1.8px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: #fff;
  color: #111827;
  line-height: 1.2;
  box-sizing: border-box;
}
.form-container select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.form-container input[type="date"]:focus,
.form-container input[type="number"]:focus,
.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.form-container option { color: #000; background: #fff; }

/* ============================================
   Styled datalist inputs (select-like)
   ============================================ */
input[list] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
  background-color: var(--card-background);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  height: 32px;
  padding: 0 2rem 0 0.6rem; /* room for chevron */
  font-size: 0.8rem;
  line-height: 1.2;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7l5 5 5-5' stroke='%2362748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
input[list]:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
/* Disabled/read-only state */
input[list][disabled] { background-color: #f3f4f6; color: #6b7280; }

/* Input affix helpers (left symbol inside input) */
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-weight: 700; }
.input-affix input { padding-left: 28px; }

/* Pulsanti Minimal */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    transition: var(--transition);
}

/* Hover senza cambio colore */
.btn:hover,
.btn:focus,
.btn:active { background: var(--primary-color); transform: none; box-shadow: none; filter: none; }

/* Rimuovi effetti hover su pulsanti nella index page e varianti */
body.index-page .btn:hover,
body.index-page .btn:focus,
body.index-page .btn:active { background: var(--primary-color); transform: none; box-shadow: none; }
body.index-page .btn-outline-primary:hover,
body.index-page .btn-outline-primary:focus,
body.index-page .btn-outline-primary:active { background: transparent; color: var(--primary-color); }
.btn-ghost:hover,
.btn-ghost:focus,
.btn-ghost:active { background: #f1f5f9; }

/* Mobile: rendi i bottoni più piccoli e compatti */
@media (max-width: 640px) {
  .btn { padding: 0.35rem 0.6rem; font-size: 0.72rem; line-height: 1.1; min-height: 30px; }
  .header-actions .btn { padding: 0.35rem 0.6rem; font-size: 0.72rem; }
  .search-inline .btn { padding: 0.35rem 0.6rem; font-size: 0.72rem; }
  .form-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.72rem; }
}

.btn:active {
    transform: translateY(0);
}

.btn-info { background: var(--primary-color); color: #fff; }
.btn-info:hover { background: var(--primary-color); }

.btn-danger { background: var(--danger-color); }
.btn-danger:hover { background: var(--danger-color); }

.btn-success { background: var(--success-color); }
.btn-success:hover { background: var(--success-color); }

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Extra compact button and icon button */
.btn-xs { padding: 0.15rem 0.35rem; font-size: 0.65rem; border-radius: var(--border-radius-sm); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--border-radius-sm); }

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.form-actions .btn { height: 32px; padding: 0 .6rem; font-size: .75rem; }

/* Alert Minimal */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tabella Minimal */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

th {
    background: var(--background-color);
    color: #000;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}

tr:hover td {
    background: rgba(37, 99, 235, 0.02);
}

/* Global cards for info sections */
.course-info,
.stats-section,
.iscritti-list,
.form-container {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.soci-list,
.pagamenti-list,
.filters {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* Info grids */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stats-grid-small { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
/* Make info items look like separated boxes */
.info-grid > div { background: var(--card-background); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); padding: 0.75rem 1rem; box-shadow: var(--shadow-sm); }

/* Titled info items */
.info-item { display: flex; flex-direction: column; gap: 0.25rem; }
.info-item-title { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 0.35rem; }
.info-item-title .icon { font-size: 0.9rem; opacity: 0.7; }
.info-item-value { font-size: 0.9rem; color: var(--text-primary); font-weight: 600; }

/* Small stat cards */
.stat-card-small { background: var(--card-background); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); padding: 0.75rem 1rem; text-align: center; box-shadow: var(--shadow-sm); transition: var(--transition); }
.stat-card-small:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-small .stat-number { font-size: 1.25rem; font-weight: 700; color: var(--primary-color); line-height: 1; }
.stat-card-small .stat-label { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

/* Status badges */
.status-active { background: var(--success-color); color: white; padding: 0.2rem 0.5rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.status-inactive { background: var(--danger-color); color: white; padding: 0.2rem 0.5rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Secondary button */
.btn-secondary { background: #e2e8f0; color: #1f2937; }
.btn-secondary:hover { background: #e2e8f0; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Table toolbar utility */
.table-toolbar { display:flex; justify-content: space-between; align-items:center; gap: 1rem; margin-bottom: 0.75rem; }

/* Reusable table classes */
.table { width:100%; border-collapse: collapse; margin-top: 0; background: transparent; border-radius: 0; overflow: hidden; box-shadow: none; border: none; font-size: 0.8rem; }
.table thead { background: transparent; }
.table th { color: #000; font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.5rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 2; }
.table td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border-color); transition: var(--transition); }
.table-hover tbody tr:hover td { background: var(--primary-light); }
.table-striped tbody tr:nth-child(even) { background: var(--background-color); }
.table-sm th, .table-sm td { padding: 0.5rem 0.5rem; }
.table-bordered th, .table-bordered td { border: 1px solid var(--border-color); }
/* keep container overflow defined above */
.table-responsive { display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling: touch; }

/* Sticky thead utility (opt-in) */
.thead-sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--background-color); }

/* Force compact action buttons inside table action cells */
.table-actions .btn,
.azioni-cell .btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
}

/* Table actions cell */
.azioni-cell, .table-actions { white-space: nowrap; }
.table-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.table-actions .btn { flex: none; }

/* Responsive action layout */
@media (max-width: 768px) {
  .table-actions { gap: 0.4rem; }
}
@media (max-width: 480px) {
  .table-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}

.status-active {
    background: var(--success-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-inactive {
    background: var(--danger-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Container e Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.soci-list,
.pagamenti-list,
.filters {
    padding: 0.75rem 0.75rem; /* keep minimal spacing for forms only; lists stay minimal */
}

/* Header Actions */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.header-actions h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-top: 2rem;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        padding: 0 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    header h1 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .header-actions {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        gap: 0.25rem;
    }

    nav a {
        padding: 0.5rem 0.75rem;
    }

    .form-container {
        padding: 1rem;
    }

    .soci-list,
    .pagamenti-list,
    .filters {
        padding: 0;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem 0.375rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem;
    }

    header h1 {
        font-size: 1.125rem;
    }

    .form-container,
    .soci-list,
    .pagamenti-list,
    .filters {
        padding: 0.75rem;
        margin: 0 -0.25rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.form-container,
.soci-list,
.pagamenti-list,
.filters,
.scadenze-list {
    animation: fadeInUp 0.4s ease-out;
}

/* ============================================
   AUTH PAGES (Login/Logout)
   ============================================ */
body.login-page,
body.logout-page {
    /* Limita la larghezza massima e centra il contenuto */
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}

.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
    margin: 0 auto; /* Centra il contenitore */
    padding: 2.5rem;
    text-align: center;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-logo {
    max-width: 120px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.auth-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.btn-auth {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Alert Messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100% - 2rem); /* Assicura che ci sia spazio ai lati */
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
    
    .auth-subtitle {
        font-size: 0.875rem;
    }
}
.login-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color), var(--success-color));
}

.login-header { text-align: center; margin-bottom: 3rem; }

.login-logo {
    width: 80px; height: 80px; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
    color: white; font-size: 2rem; font-weight: 700; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.login-logo::before {
    content: '';
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%) translateY(-100%) rotate(45deg);} 100% { transform: translateX(100%) translateY(100%) rotate(45deg);} }

.login-title {
    font-size: var(--font-size-2xl); font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.5rem;
}
.login-subtitle { color: var(--gray-600); font-size: var(--font-size-sm); margin-bottom: 1rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--gray-700); font-size: var(--font-size-sm); }
.form-input {
    width: 100%; padding: 1rem; border: 2px solid var(--gray-200); border-radius: var(--border-radius);
    font-size: var(--font-size-base); background: var(--gray-50); color: var(--gray-900); transition: all 0.2s ease;
}
.form-input:focus { outline: none; border-color: var(--primary-color); background: white; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
.form-input::placeholder { color: var(--gray-400); }

.password-input-container { position: relative; }
.password-toggle {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 1.2rem; padding: 0.25rem;
    border-radius: var(--border-radius-sm); transition: all 0.2s ease;
}
.password-toggle:hover { color: var(--primary-color); background: var(--gray-100); }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.checkbox-remember { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-remember input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--primary-color); }

.forgot-password { color: var(--primary-color); text-decoration: none; font-size: var(--font-size-sm); font-weight: 500; transition: all 0.2s ease; }
.forgot-password:hover { color: var(--primary-hover); text-decoration: underline; }

.btn-login {
    width: 100%; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; border: none;
    padding: 1rem 2rem; border-radius: var(--border-radius); font-size: var(--font-size-base); font-weight: 600; cursor: pointer;
    transition: all 0.2s ease; margin-bottom: 1.5rem; position: relative; overflow: hidden; font-family: var(--font-family-sans);
}
.btn-login::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.5s; }
.btn-login:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-login:hover::before { left: 100%; }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.login-footer { text-align: center; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--gray-200); }
.login-footer p { color: var(--gray-500); font-size: var(--font-size-xs); margin: 0; }

.loading { display: none; text-align: center; margin: 1rem 0; }
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top: 2px solid white; animation: spin 1s linear infinite; display: inline-block; margin-right: 0.5rem; }
@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

.logo-container { margin-bottom: 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.logo-img { width: 400px; height: 150px; object-fit: contain; border-radius: 20px; background: rgba(255, 255, 255, 0.1); padding: 1rem; backdrop-filter: blur(10px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); border: 2px solid rgba(255, 255, 255, 0.2); }

@media (max-width: 768px) { .logo-img { width: 300px; height: 120px; } }
@media (max-width: 480px) { .logo-img { width: 250px; height: 100px; padding: 0.75rem; } }

.hidden { display: none !important; }

/* Header Moderno */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

nav a:hover,
nav a.active {
    background-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Dashboard Moderna */
.dashboard {
    display: grid;
    gap: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

/* Form Container Moderno */
.form-container {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.form-container h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--card-background);
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* Pulsanti Moderni */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger,
a.btn-danger,
.btn.btn-danger,
a.btn.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
    color: #fff !important;
}

.btn-danger:hover,
a.btn-danger:hover,
.btn.btn-danger:hover,
a.btn.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
}

/* Compact buttons inside tables globally */
.movimenti-table .btn,
.movimenti-table a.btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  line-height: 1.1;
  border-radius: 6px;
}

/* Contabilità: evidenzia Importo per Entrata/Spesa con contorno colore */
.movimenti-table td.importo-entrata {
  border: 2px solid #16a34a !important; /* verde */
  background: rgba(22, 163, 74, 0.06);
  border-radius: 8px;
}
.movimenti-table td.importo-uscita {
  border: 2px solid #dc2626 !important; /* rosso */
  background: rgba(220, 38, 38, 0.06);
  border-radius: 8px;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Alert Moderni */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
}

/* Tabella Moderna */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

th {
    background: linear-gradient(135deg, var(--background-color), #f1f5f9);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

tr:hover td {
    background: rgba(37, 99, 235, 0.02);
}

.status-active {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-inactive {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Container e Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.soci-list,
.pagamenti-list,
.filters {
    padding: 1rem 0; /* keep forms spacing vertical only */
}

/* Header Actions */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-actions h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        padding: 0 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .header-actions {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        gap: 0.25rem;
    }

    nav a {
        padding: 0.75rem 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .soci-list,
    .pagamenti-list,
    .filters {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .form-container,
    .soci-list,
    .pagamenti-list,
    .filters {
        padding: 1rem;
        margin: 0 -0.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.form-container,
.soci-list,
.pagamenti-list,
.filters,
.scadenze-list {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   STILI PER LA PAGINA SCADENZE
   ============================================ */

.scadenze-list {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.scadenze-list h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scadenze-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.scadenze-table th,
.scadenze-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 0.875rem;
}

.scadenze-table th {
    background: var(--background-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stili per la tabella scadenze semplificata */
.socio-info-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.socio-info-cell strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.socio-email-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Miglioramento della responsività per le scadenze */
@media (max-width: 1024px) {
    .scadenze-table-container {
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .scadenze-table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .scadenze-table-container {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    .socio-info-cell strong {
        font-size: 0.85rem;
    }

    .socio-email-cell {
        font-size: 0.75rem;
    }

    .scadenze-table th,
    .scadenze-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.8rem;
    }
}

/* Stili per evidenziare le righe non pagate */
.scadenze-table tbody tr:not(.pagato-row) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.02), rgba(239, 68, 68, 0.01));
}

.scadenze-table tbody tr:not(.pagato-row):hover td {
    background: rgba(239, 68, 68, 0.05);
}

/* Miglioramento del contrasto per gli stati di pagamento */
.scadenze-table .status-active {
    background: var(--success-color);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.scadenze-table .status-inactive {
    background: var(--danger-color);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Stili per i filtri */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-form select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Stili per le statistiche delle scadenze */
.stats-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.stats-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stili per il messaggio quando non ci sono dati */
.no-data {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.no-data h3 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.no-data p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.no-data .alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin: 1rem 0;
}

.no-data .alert-info h4 {
    margin: 0 0 1rem 0;
    color: #1e40af;
}

.no-data .alert-info ol {
    text-align: left;
    margin: 0;
    padding-left: 1.25rem;
}

.no-data .alert-info li {
    margin-bottom: 0.5rem;
}

.no-data .alert-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.no-data .alert-info a:hover {
    text-decoration: underline;
}

/* Stili per le azioni rapide nella dashboard */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.action-card.primary {
    background: var(--primary-color);
    color: white;
}

.action-card .action-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.action-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
    font-size: 0.875rem;
}

.action-card.primary p {
    color: rgba(255, 255, 255, 0.9);
}

.action-card .action-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    font-size: 0.8rem;
}

.action-card.primary .action-button {
    background: rgba(255, 255, 255, 0.2);
}

.action-card:not(.primary) .action-button {
    background: var(--primary-color);
    color: white;
}

.action-card .action-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Stili per la ricerca */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-input-group {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.search-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
}

.search-input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-input-group .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

/* Stili per le informazioni sui soci */
.socio-dettagli {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.socio-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.socio-titolo h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.socio-status {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.socio-status.active {
    background: rgba(255, 255, 255, 0.2);
}

.socio-status.inactive {
    background: rgba(255, 255, 255, 0.1);
}

.socio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--background-color);
}

.socio-info-section {
    padding: 1.5rem;
}

.socio-info-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: var(--card-background);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.info-item label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.soci-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.suggestion-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.suggestion-card h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.suggestion-card p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.form-container,
.soci-list,
.pagamenti-list,
.filters,
.scadenze-list {
    animation: fadeInUp 0.4s ease-out;
}

/* ===================== Admin page table ===================== */
body.admin-page { background: var(--gray-50); color: var(--gray-800); }
body.admin-page .container { max-width: 1600px; margin: .75rem auto; padding: 0; }

/* Table */
/* When using movimenti-table, enforce compactness on admin */
body.admin-page .movimenti-table { font-size: .7rem; }
body.admin-page .movimenti-table th, body.admin-page .movimenti-table td { padding: .35rem .3rem; }
body.admin-page .movimenti-table .col-actions { white-space: nowrap; }
body.admin-page .movimenti-table tr { line-height: 1.1; }
/* Headers like other tables: black on white */
body.admin-page .movimenti-table thead th { background: #fff; color: #111827; font-weight: 700; border-bottom: 1px solid var(--border-color); }

/* Status pill */
.status-pill { display:inline-flex; align-items:center; gap:.35rem; padding:.15rem .5rem; border-radius:999px; font-size:.7rem; font-weight:700; border:1px solid transparent; }
.status-pill.active { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.status-pill.inactive { background:#fee2e2; color:#991b1b; border-color:#fecaca; }

/* Action buttons */
.btn-icon { background:#f3f4f6; color:#111827; border:1px solid #e5e7eb; border-radius:8px; padding:.35rem .5rem; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:.35rem; }
.btn-icon:hover { background:#e5e7eb; }
.btn-icon.primary { background: var(--primary-color); color:#fff; border-color: var(--primary-color); }
.btn-icon.danger { background:#ef4444; color:#fff; border-color:#ef4444; }
.btn-icon.secondary { background:#4b5563; color:#fff; border-color:#4b5563; }

/* Expandable settings row */
.asd-settings { background:#f8fafc; border-top:1px solid var(--border-color); }
.asd-settings .settings-inner { padding: 1rem; }
.settings-section { background:#fff; border:1px solid var(--border-color); border-radius:12px; padding:1rem; margin-bottom:1rem; box-shadow: var(--shadow-sm); }
.settings-title { margin:0 0 .75rem; font-weight:800; color:#111827; display:flex; align-items:center; gap:.5rem; }

/* Admin settings forms: side-by-side responsive fields */
body.admin-page .settings-section .asd-info,
body.admin-page .form-modifica .asd-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem .5rem;
}
body.admin-page .settings-section .info-item label { margin-bottom: .2rem; font-size: .8rem; }
body.admin-page .settings-section .form-input { padding: .5rem .6rem; font-size: .85rem; }

/* Create ASD form: compact responsive grid like settings */
body.admin-page #form-nuova-asd .asd-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem .5rem;
}
body.admin-page #form-nuova-asd .info-item label { margin-bottom: .2rem; font-size: .8rem; }
body.admin-page #form-nuova-asd .form-input { padding: .5rem .6rem; font-size: .85rem; }

@media (max-width: 768px) {
  /* Micro-spacing on mobile */
  body.admin-page .container { padding: 0 .5rem; }
  body.admin-page .asd-table thead th, body.admin-page .asd-table tbody td { padding:.5rem; font-size:.85rem; }
  .btn, .btn-icon { padding:.45rem .6rem; font-size:.8rem; }
}

/* Profile page */
body.profile-page { background: var(--gray-50); color: var(--gray-800); }
body.profile-page .profilo-dashboard { max-width: 1200px; margin: 0 auto; padding: 1rem; }
body.profile-page .profile-info { background:#fff; border:1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; text-align:center; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
body.profile-page .profile-info::before { content:""; position:absolute; top:0; left:0; right:0; height:4px; background: linear-gradient(90deg, var(--primary-color), var(--info-color)); }
body.profile-page .profile-avatar { font-size: 4rem; margin-bottom: 1rem; opacity:.9; }
body.profile-page .profile-name { font-weight:800; color:#111827; font-size: 1.25rem; margin-bottom: .25rem; }
body.profile-page .profile-role { color:#6b7280; margin-bottom: 1.25rem; }
body.profile-page .profile-details { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-top: 1rem; }
body.profile-page .detail-item { background:#f8fafc; border:1px solid var(--gray-200); border-radius: var(--border-radius); padding: 1rem; }
body.profile-page .detail-label { font-size:.75rem; color: var(--text-secondary); font-weight:600; text-transform: uppercase; letter-spacing:.04em; margin-bottom:.25rem; }
body.profile-page .detail-value { color:#111827; font-weight:600; }

/* Generic alerts */
.alert { padding: .75rem 1rem; border-radius: var(--border-radius-sm); border:1px solid; font-weight:600; font-size:.85rem; }
.alert-success { background:#d1fae5; color:#065f46; border-color:#a7f3d0; }
.alert-danger { background:#fee2e2; color:#991b1b; border-color:#fecaca; }

/* Generic button */
.btn { background: var(--primary-color); color:#fff; border:none; padding:.6rem .9rem; border-radius: var(--border-radius-sm); font-weight:700; cursor:pointer; transition:.2s; display:inline-flex; align-items:center; gap:.4rem; }
.btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:disabled { opacity:.6; cursor:not-allowed; }

/* ============================================
   Settings (Impostazioni) Page
   ============================================ */
body.settings-page { background: var(--gray-50); color: var(--gray-800); font-size: 0.95rem; }
body.settings-page .settings-dashboard { padding: 1.25rem; max-width: 1600px; margin: 0 auto; }
@media (max-width: 768px) { body.settings-page .settings-dashboard { padding: 1rem; } }

/* Tabs */
body.settings-page .tabs-container { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); overflow:hidden; box-shadow: var(--shadow-sm); margin-bottom: 2rem; }
/* Modern pill-style tabs */
body.settings-page .tabs-header { background: var(--gray-50); border-bottom:1px solid var(--gray-200); display:flex; gap:.35rem; overflow-x:auto; padding:.5rem; position: sticky; top: 0; z-index: 5; }
body.settings-page .tab-button { padding:.45rem .85rem; background:#fff; color: var(--gray-700); border:1px solid var(--gray-200); border-radius: 999px; cursor:pointer; font-weight:700; font-size:.85rem; white-space:nowrap; box-shadow: var(--shadow-xs); transition: all .18s ease; }
body.settings-page .tab-button:hover { background: var(--gray-100); color:#111827; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
body.settings-page .tab-button.active { background: var(--primary-color); color:#fff; border-color: var(--primary-color); box-shadow: var(--shadow-sm); }
body.settings-page .tab-content { display:none; padding: 1rem; background:#fff; }
body.settings-page .tab-content.active { display:block; }

/* Dropdown (accordion) */
body.settings-page .dropdown-section { margin-bottom: 1.25rem; border:1px solid var(--gray-200); border-radius: var(--border-radius); background:#fff; box-shadow: var(--shadow-sm); overflow:hidden; }
body.settings-page .dropdown-header { padding: .75rem 1rem; background: var(--gray-50); cursor:pointer; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--gray-200); }
body.settings-page .dropdown-header:hover { background: var(--gray-100); }
body.settings-page .dropdown-header h4 { margin:0; font-weight:700; color:#111827; display:flex; align-items:center; gap:.5rem; }
body.settings-page .dropdown-icon { transition: transform .2s ease; color: var(--gray-500); }
body.settings-page .dropdown-section.expanded .dropdown-icon { transform: rotate(180deg); }
body.settings-page .dropdown-content { display:none; padding: 1.25rem; background:#fff; }
body.settings-page .dropdown-section.expanded .dropdown-content { display:block; }

/* Cards */
body.settings-page .settings-card { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); padding:1rem; margin-bottom:1rem; box-shadow: var(--shadow-sm); }
body.settings-page .settings-card h5 { margin:0 0 .75rem 0; font-weight:700; color:#111827; display:flex; align-items:center; gap:.5rem; font-size: 1rem; }
body.settings-page .settings-card p { color: var(--text-secondary); margin-bottom: 1rem; }

/* Forms */
body.settings-page .form-section { background: var(--gray-50); border:1px solid var(--gray-200); border-radius: var(--border-radius); padding: 1rem; margin-bottom: 1rem; }
body.settings-page .form-section h5 { margin:0 0 .75rem 0; font-weight:700; color:#111827; font-size: 1rem; }
body.settings-page .form-row { display:grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
@media (max-width: 768px) { body.settings-page .form-row { grid-template-columns: 1fr; } }
body.settings-page .form-group { margin-bottom: .8rem; }
body.settings-page .form-group label { display:block; margin-bottom:.3rem; font-weight:600; color: var(--gray-700); font-size:.8rem; }
body.settings-page .form-group input,
body.settings-page .form-group select,
body.settings-page .form-group textarea { width:100%; padding:.55rem .75rem; border: 2px solid var(--gray-200); border-radius: var(--border-radius-sm); background:#fff; font-size:.9rem; }
body.settings-page .form-group input,
body.settings-page .form-group select { font-size:.9rem; padding:.55rem .75rem; }
body.settings-page .form-group input:focus,
body.settings-page .form-group select:focus,
body.settings-page .form-group textarea:focus { outline:none; border-color: var(--primary-color); background:#fff; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
body.settings-page .form-actions { display:flex; gap:.5rem; justify-content:center; margin-top:.75rem; padding-top:.75rem; border-top:1px solid var(--gray-200); flex-wrap:wrap; }

/* Grids */
body.settings-page .summary-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:1rem; margin-bottom:1rem; }
body.settings-page .summary-item { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); padding:.85rem; text-align:center; box-shadow: var(--shadow-sm); }
body.settings-page .backup-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap:1rem; margin-bottom:1rem; }
body.settings-page .backup-card { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); padding:1.25rem; text-align:center; box-shadow: var(--shadow-sm); }
body.settings-page .backup-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
body.settings-page .maintenance-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:1rem; margin-bottom:1rem; }
body.settings-page .maintenance-card { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); padding:1.25rem; text-align:center; box-shadow: var(--shadow-sm); }

/* Logo preview */
body.settings-page .logo-preview { text-align:center; margin-bottom:1rem; padding:1rem; border:2px dashed var(--gray-300); border-radius: var(--border-radius); background: var(--gray-50); min-height: 100px; display:flex; align-items:center; justify-content:center; }
body.settings-page .logo-preview img { max-width: 200px; max-height: 100px; object-fit: contain; border-radius: var(--border-radius-sm); }

/* Logs */
body.settings-page .log-container { background:#fff; border:1px solid var(--gray-200); border-radius: var(--border-radius); overflow:hidden; box-shadow: var(--shadow-sm); }
body.settings-page .log-entry { border-bottom:1px solid var(--gray-200); padding: .75rem 1rem; }
body.settings-page .log-entry:hover { background: var(--gray-50); }
body.settings-page .log-filters input,
body.settings-page .log-filters select { padding:.5rem .75rem; border:2px solid var(--gray-200); border-radius: var(--border-radius-sm); background:#f8fafc; }
body.settings-page .log-filters input:focus,
body.settings-page .log-filters select:focus { outline:none; border-color: var(--primary-color); background:#fff; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }

/* Alerts (reuse global .alert, ensure spacing) */
body.settings-page .alert { margin: .75rem 0; }

/* Associazione - Riepilogo dati (righe compatte) */
body.settings-page .assoc-rows { display:grid; grid-template-columns: 1fr; gap:.5rem; }
body.settings-page .assoc-row { display:grid; grid-template-columns: 150px 1fr; align-items:center; background:#f8fafc; border:1px solid var(--gray-200); border-radius: var(--border-radius-sm); padding:.5rem .75rem; }
@media (max-width: 640px) { body.settings-page .assoc-row { grid-template-columns: 1fr; row-gap:.25rem; } }
body.settings-page .assoc-label { font-weight:700; color:#374151; font-size:.85rem; }
body.settings-page .assoc-value { color:#111827; font-weight:600; word-break: break-word; }

/* Header spacing for messages */
body.settings-page .header-actions { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom: .75rem; }
body.settings-page #header-messages .alert { margin:.25rem 0; }

/* Uniformare TUTTE le tab: stessa spaziatura tra header tab e primo blocco */
body.settings-page .tab-content { padding: 1rem; }
/* Spaziatura uniforme dei blocchi in tutte le tab */
body.settings-page .tab-content > .dropdown-section { margin-top: .75rem; }
body.settings-page .tab-content > .dropdown-section:first-child { margin-top: 0; }

/* Cariche Sociali: use the same exact styles as other tabs (no overrides) */

/* === Global unified form spacing (final override) === */
.form-container { margin: 0.75rem 0 1rem !important; }
@media (max-width: 768px) {
  .form-container { margin: 0.5rem 0 0.75rem !important; }
}
