/* ================================================================
   Centro Culturale Italo-Tedesco ETS – gestionale v3
   Stile pulito e leggero, coerente con italotedesco2
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0; padding: 0;
    color: #333;
    line-height: 1.6;
}

/* --- NAV --- */
.main-nav {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.nav-brand { font-weight: bold; font-size: 1rem; flex: 1 1 auto; white-space: nowrap; }
.nav-links  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links a { color: white; text-decoration: none; font-size: .95rem; padding: 4px 6px; border-radius: 3px; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.2); text-decoration: underline; }
.nav-links .sep { color: rgba(255,255,255,.5); }
.nav-user { font-size: .85rem; white-space: nowrap; }
.nav-user a { color: white; text-decoration: underline; }

/* --- CONTAINER --- */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

/* --- CARDS / BOXES --- */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    padding: 24px;
    margin-bottom: 20px;
}
.box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

/* --- TITOLI --- */
h1 { font-size: 1.5rem; color: #2c3e50; margin: 0 0 16px; }
h2 { font-size: 1.2rem; color: #2c3e50; margin: 0 0 12px; }
h3 { font-size: 1.05rem; color: #2c3e50; margin: 0 0 10px; }

/* --- ALERTS --- */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: .93rem; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info    { background: #d1ecf1; color: #0c5460; }

/* --- FORMS --- */
label { display: block; margin: 8px 0 3px; font-weight: bold; font-size: .92rem; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=password], input[type=time],
select, textarea {
    width: 100%; padding: 8px 10px;
    border: 1px solid #ccc; border-radius: 4px;
    font-size: .93rem; background: white;
}
input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus {
    border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,.15);
}
input[type=checkbox] { width: auto; margin-right: 6px; }
.checkbox-row { display: flex; align-items: center; margin: 8px 0; }
.checkbox-row label { margin: 0; font-weight: normal; }
fieldset { border: 1px solid #e0e0e0; border-radius: 6px; padding: 14px; margin: 14px 0; }
legend   { font-weight: bold; padding: 0 6px; }

/* --- BUTTONS --- */
.btn        { display: inline-block; padding: 8px 18px; border-radius: 4px; border: none; cursor: pointer; font-size: .92rem; text-decoration: none; }
.btn-primary{ background: #007bff; color: white; }
.btn-primary:hover { background: #0056b3; }
.btn-success{ background: #28a745; color: white; }
.btn-success:hover { background: #1e7e34; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover  { background: #bd2130; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #545b62; }
.btn-sm { padding: 4px 10px; font-size: .84rem; }
/* Uniforma altezza button e anchor con classe .btn:
   <button> ha box-sizing content-box e line-height diverso da <a> → forziamo stessa resa */
.btn { line-height: 1.5; vertical-align: middle; }
a.btn { display: inline-flex; align-items: center; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* Nella barra filtri i tasti Filtra/Reset devono avere altezza identica */
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.filter-actions .btn,
.filter-actions a.btn { box-sizing: border-box; height: 34px; line-height: 1; display: inline-flex; align-items: center; }

/* --- TABELLE --- */
table { width: 100%; border-collapse: collapse; background: white; }
table.table-card { box-shadow: 0 2px 6px rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: .92rem; }
th { background: #f8f9fa; font-weight: bold; }
tr:hover td { background: #f9f9f9; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.nowrap      { white-space: nowrap; }

/* --- FILTRI --- */
.filters {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filters .filter-group { display: flex; flex-direction: column; min-width: 140px; }
.filters .filter-group label { font-size: .85rem; margin-bottom: 3px; }
.filters .filter-group select,
.filters .filter-group input { width: 100%; }

/* --- BADGES --- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .8rem; font-weight: bold; }
.badge-green  { background: #d4edda; color: #155724; }
.badge-red    { background: #f8d7da; color: #721c24; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-blue   { background: #cce5ff; color: #004085; }
.badge-gray   { background: #e2e3e5; color: #383d41; }
.btn-orange   { background:#fd7e14; color:#fff; border-color:#fd7e14; }
.btn-orange:hover { background:#e96c00; border-color:#e96c00; }
.badge-tipo-quota-socio         { background:#fff3cd; color:#856404; }      /* giallo */
.badge-tipo-corso               { background:#cce5ff; color:#004085; }      /* blu */
.badge-tipo-workshop            { background:#d4edda; color:#155724; }      /* verde */
.badge-tipo-evento              { background:#f8d7da; color:#721c24; }      /* rosso */
.badge-tipo-lezione-individuale { background:#e2d9f3; color:#432874; }      /* viola */
.badge-tipo-altro               { background:#e2e3e5; color:#383d41; }      /* grigio */

/* --- CAMPO NON APPLICABILE (es. quota socio su evento gratuito) --- */
.simbolo-na { color: #c9c9c9; font-weight: bold; cursor: help; }
.campo-na { opacity: .55; }
.campo-na label { color: #b5b5b5; }
td.cella-na { color: #c9c9c9; }

/* --- DASHBOARD WIDGET --- */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.widget { background: white; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.08); padding: 20px; text-align: center; }
.widget .widget-num { font-size: 2.2rem; font-weight: bold; color: #007bff; }
.widget .widget-lbl { font-size: .9rem; color: #666; margin-top: 4px; }

/* --- PAGINA PUBBLICA ISCRIZIONE --- */
.public-container { max-width: 700px; margin: 30px auto; padding: 0 20px; }

/* --- LOGIN PAGE --- */
.login-wrap { max-width: 380px; margin: 80px auto; }

/* --- UTILITY --- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: #6c757d; font-size: .88rem; }
.text-green  { color: #28a745; }
.text-red    { color: #dc3545; }
.text-orange { color: #fd7e14; }
hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }
