/* =====================================================================
   tema.css - aspetto unico di tutta l'area riservata
   Caricato sia dalle pagine storiche (Bootstrap 3, via header.html)
   sia da quelle nuove (Bootstrap 5, via header.php).
   ===================================================================== */
:root {
    --ar-blu: #0d6efd;
    --ar-blu-scuro: #0a58ca;
    --ar-arancio: #f28c28;
    --ar-scuro: #1f2a44;
    --ar-sfondo: #f4f6fa;
    --ar-linea: #e3e8f0;
}

html { font-size: 16px !important; }   /* Bootstrap 3 la porta a 10px: stessa misura ovunque */
html body {
    font-size: 15px;
    background: var(--ar-sfondo) !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    color: #1e293b;
    margin: 0;
}

/* ---------- testata ---------- */
body > header {
    background: linear-gradient(135deg, var(--ar-blu), var(--ar-blu-scuro)) !important;
    color: #fff !important;
    padding: .6rem 1rem !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between !important;
    gap: 1rem;
}
body > header .ar-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
body > header .header-logo { max-width: 150px; height: auto; display: block; }
body > header .intestazione, body > header .intestazione h2 { flex: 1; text-align: center !important; display: block !important; }
html body > header .intestazione h2, html body > header .intestazione h2[style] {
    font-family: "Bowlby One SC", system-ui, sans-serif !important;
    font-weight: 400 !important; font-size: 1.6rem !important; line-height: 1.25; color: #fff !important; margin: 0 !important;
}
html body > header h2::after { display: none !important; }
html body > header .intestazione h2 small { color: #fff !important; font-size: .75em; opacity: .95; }
body > header .ar-head-dx, body > header > div:last-child { text-align: center; min-width: 170px; }
body > header #orario h5, body > header #data h5 { color: #fff !important; font-size: .95rem !important; margin: 0 0 .3rem 0 !important; font-weight: 500; }
body > header .online h5 { color: #fff !important; font-size: .95rem !important; cursor: pointer; margin: 0 !important; font-weight: 600; }
body > header #utenti { display: none; font-size: .85rem; margin-top: .3rem; text-align: left; }
body > header #utenti.mostra { display: block; }
body > header #utenti, body > header #utenti p { color: #fff !important; }
body > header #utenti i { color: #86efac !important; }
@media (max-width: 768px) {
    body > header .intestazione { display: none !important; }
    body > header .header-logo { max-width: 110px; }
}

/* ---------- menu unico ---------- */
.ar-nav {
    background: var(--ar-blu-scuro);
    padding: .4rem .8rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
    position: relative; z-index: 1030;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
    margin-bottom: 1rem;
}
.ar-nav .ar-voci { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.ar-nav a, .ar-nav summary, .ar-nav .ar-burger {
    color: #fff !important; text-decoration: none !important;
    padding: .45rem .8rem; border-radius: 8px; border: 0; background: transparent;
    font-weight: 600; font-size: .95rem; line-height: 1.3;
    display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.ar-nav summary::-webkit-details-marker { display: none; }
.ar-nav summary::marker { content: ""; }
.ar-nav a:hover, .ar-nav summary:hover, .ar-nav .ar-burger:hover { background: rgba(255, 255, 255, .16); }
.ar-nav a.att { background: #fff; color: var(--ar-blu-scuro) !important; }
.ar-nav details { position: relative; }
.ar-nav .ar-sub {
    position: absolute; right: 0; top: calc(100% + .3rem); min-width: 210px;
    background: #fff; border-radius: 12px; padding: .4rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .2);
}
.ar-nav .ar-sub a { color: var(--ar-scuro) !important; display: flex; width: 100%; }
.ar-nav .ar-sub a:hover { background: #f1f5f9; }
.ar-nav .ar-sub a.att { background: #e7f0ff; color: var(--ar-blu) !important; }
.ar-nav .ar-sub a.ar-esci { color: #dc2626 !important; border-top: 1px solid var(--ar-linea); border-radius: 0 0 8px 8px; margin-top: .2rem; }
.ar-nav .ar-burger { display: none; }
@media (max-width: 768px) {
    .ar-nav .ar-burger { display: inline-flex; }
    .ar-nav .ar-voci { display: none; width: 100%; flex-direction: column; align-items: stretch; }
    .ar-nav.aperto .ar-voci { display: flex; }
    .ar-nav .ar-voci a, .ar-nav summary { width: 100%; padding: .7rem .8rem; }
    .ar-nav .ar-sub { position: static; box-shadow: none; background: rgba(255, 255, 255, .1); }
    .ar-nav .ar-sub a { color: #fff !important; }
    .ar-nav .ar-sub a.att { background: #fff; color: var(--ar-blu) !important; }
}
/* vecchi menu nascosti se ancora presenti in qualche pagina */
#myNav, span.menu, #navDesktop, #navMobile, #navMobilePnl { display: none !important; }

/* ---------- contenuto delle pagine storiche ---------- */
body > .container, body > div.container, body > .container-fluid:not(header) { max-width: 1320px; width: auto !important; margin-left: auto; margin-right: auto; }

/* titoli: niente piu' arancione arial black */
h1, h2, h3, h4 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important; }
.container h2[style], .container-fluid h2[style], main h2, body > h2, .container > h2, .container-fluid > h2 {
    color: var(--ar-scuro) !important; background: transparent !important;
    font-weight: 800 !important; font-size: 1.6rem !important; text-align: left;
    margin: .4rem 0 1rem !important; padding: 0 !important;
}
.container h2[style]::after, main h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 4px; background: var(--ar-arancio); margin-top: .35rem; }
article h3, .container h3 { color: var(--ar-scuro) !important; font-weight: 700; }

/* schede */
article, .panel, .card, .well {
    background: #fff !important; border: 0 !important; border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08) !important;
}
article { padding: 1rem !important; margin: .5rem !important; }
.panel-heading, .card-header { background: #fff !important; border-bottom: 1px solid var(--ar-linea) !important; font-weight: 700; border-radius: 14px 14px 0 0 !important; }
article p[style*="gray"], article p { background: transparent !important; color: inherit !important; width: auto !important; }

/* tabelle */
.table { background: #fff; border-radius: 12px; overflow: hidden; }
.table > thead > tr > th, .table th { background: #f7f9fc !important; color: #64748b; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; border-color: var(--ar-linea) !important; }
.table td { border-color: #eef1f6 !important; vertical-align: middle !important; }

/* pulsanti */
.btn { border-radius: 10px !important; font-weight: 600; }
.btn-warning { background: var(--ar-arancio) !important; border-color: var(--ar-arancio) !important; color: #fff !important; }
.btn-warning:hover { filter: brightness(.95); }
.btn-success { background: #16a34a !important; border-color: #16a34a !important; }
.btn-primary { background: var(--ar-blu); border-color: var(--ar-blu); }

/* campi */
input[type=text], input[type=date], input[type=number], input[type=email], input[type=password], input[type=tel], select, textarea {
    border: 1px solid #cbd5e1; border-radius: 8px; padding: .35rem .6rem; background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13, 110, 253, .25); border-color: var(--ar-blu); }
.search-container { background: #fff; border-radius: 14px; padding: .8rem; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); margin-bottom: 1rem; }
.search-container button { border: 0; background: var(--ar-blu); color: #fff; border-radius: 8px; padding: .4rem .8rem; }

/* pie' di pagina */
body > footer, footer.container, footer.container-fluid {
    background: transparent !important; color: #64748b !important;
    text-transform: none !important; font-weight: 600 !important; font-size: .85rem !important;
    padding: 1.2rem .5rem !important; margin-top: 1.5rem; text-align: center; border-top: 1px solid var(--ar-linea);
    position: static !important; width: 100% !important;
}
body > footer h5, body > footer p { font-size: .85rem !important; font-weight: 600 !important; margin: 0 !important; color: #64748b !important; }


/* =====================================================================
   Moduli delle pagine storiche (body.vecchia, impostata da header.html):
   stesso aspetto dei moduli nuovi senza toccare la logica delle pagine
   ===================================================================== */
body.vecchia > .container, body.vecchia > .container-fluid:not(header) { padding-left: 1rem; padding-right: 1rem; }
body.vecchia form:not(.search-container form):not([style*="display:inline"]) {
    background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    padding: 1.2rem 1.3rem; max-width: 1140px; margin: 0 auto 1.2rem; text-align: left !important;
}
body.vecchia form .container-fluid { display: flex; flex-wrap: wrap; gap: 0 1rem; padding: 0; margin: 0 0 .3rem 0; }
body.vecchia form .container-fluid::before, body.vecchia form .container-fluid::after { display: none; }
body.vecchia form .container-fluid > p[class*="col-"], body.vecchia form .container-fluid > p {
    float: none; width: auto; flex: 1 1 220px; text-align: left !important; padding: 0; margin: .4rem 0;
    font-weight: 600; font-size: .85rem; color: #475569;
}
body.vecchia form .container-fluid > p.col-md-12, body.vecchia form .container-fluid > p.col-lg-12 { flex-basis: 100%; }
body.vecchia form p > input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=file]),
body.vecchia form p > select, body.vecchia form p > textarea {
    width: 100%; margin-top: .25rem; font-weight: 400; font-size: .95rem; color: #1e293b; padding: .45rem .65rem; min-height: 38px;
}
body.vecchia form p > input[type=file] { display: block; margin-top: .3rem; font-weight: 400; }
body.vecchia form textarea { width: 100%; min-height: 90px; }
body.vecchia form input[type=checkbox], body.vecchia form input[type=radio] { width: 1.05rem; height: 1.05rem; vertical-align: -2px; margin-right: .3rem; accent-color: #0d6efd; }
body.vecchia form h4, body.vecchia form h3 {
    flex-basis: 100%; float: none; width: 100%; text-align: left !important;
    font-size: 1rem !important; font-weight: 800 !important; color: #1f2a44 !important;
    border-top: 1px solid #e3e8f0; padding: .9rem 0 0 0 !important; margin: .8rem 0 .2rem !important;
}
body.vecchia form .container-fluid:first-child > h4:first-child { border-top: 0; padding-top: 0 !important; margin-top: 0 !important; }
body.vecchia form h4[class*="col-"] { flex: 1 1 240px; width: auto; border-top: 0; padding-top: .2rem !important; font-weight: 600 !important; }
body.vecchia form label { font-weight: 600; color: #334155; margin-right: .5rem; }
body.vecchia form input[type=submit], body.vecchia form button[type=submit] {
    display: block; margin: 1.2rem auto 0; padding: .65rem 2.2rem; font-size: 1.05rem; border-radius: 12px !important;
}
body.vecchia > .container > h2, body.vecchia > .container-fluid > h2, body.vecchia .container > h2[style] { max-width: 1140px; margin-left: auto !important; margin-right: auto !important; }
body.vecchia article { text-align: left; }
body.vecchia h1[style*="center"] { font-size: 1.6rem; font-weight: 800; color: #1f2a44; margin-top: 2rem; }

/* stampa */
@media print {
    body > header, .ar-nav, body > footer { display: none !important; }
    html body { background: #fff !important; }
}
