/* Pagine di accesso, account e amministrazione */
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.sitebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--surface); }
.sitebar .brand { font-family: var(--font-display); font-weight: 700; color: var(--ink); text-decoration: none; }
.sitebar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.sitebar nav a, .linkbtn { color: var(--accent); text-decoration: none; font-weight: 600; }
.sitebar .who { color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }
form.inline { display: inline; margin: 0; }
main.page { width: 100%; max-width: 860px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-left, 0px)) 48px; display: grid; gap: 20px; flex: 1; align-content: start; }
body.is-app #app { flex: 1; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 12px; max-width: 100%; }
main.page > .card:only-child { max-width: 520px; width: 100%; justify-self: center; }
.card h1, main.page > h1 { font-family: var(--font-display); font-size: 28px; margin: 0; line-height: 1.1; }
.card h2 { font-family: var(--font-display); font-size: 19px; margin: 10px 0 0; }
.card h3 { margin: 0; font-size: 16px; }
.card p { margin: 0; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input[type=text], .form input:not([type]), .form input[type=email], .form input[type=password] { font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); }
.form button { justify-self: start; }
.hp { position: absolute; left: -9999px; }
a.btn { display: inline-block; text-decoration: none; font-weight: 600; border-radius: 8px; padding: 9px 16px; background: var(--accent); color: var(--surface); border: 1px solid var(--accent); }
a.btn.ghost { background: transparent; color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
button.small { padding: 5px 10px; font-size: 13px; }
button.danger { background: #a3241b; border-color: #a3241b; }
.msg.ok { color: var(--good); font-weight: 600; }
.small { font-size: 13px; color: var(--muted); }
.count { font-family: var(--font-num); font-size: 14px; color: var(--muted); font-weight: 400; }
.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; color: var(--muted); }
table.users td, table.users th { font-size: 14px; }
td.acts { white-space: nowrap; text-align: right; }
td.acts form { margin-left: 4px; }
code.temp { font-family: var(--font-num); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; user-select: all; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.upl { border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; display: grid; gap: 8px; background: var(--accent-soft); }
.upl .filebtn { justify-self: start; position: relative; }
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--ink); }
.sitefoot { text-align: center; padding: 16px; font-size: 13px; }
.sitefoot a { color: var(--muted); }
td.acts button { color: var(--surface); }
td.acts button.ghost { color: var(--accent); background: transparent; }
.sitefoot .copy { margin: 0 0 4px; color: var(--muted); font-size: 12.5px; }
table.log tr.ko td { color: var(--accent); }
table.log td code { font-family: var(--font-num); font-size: 13px; }
.card a { color: var(--accent); }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.card h3 { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
button.small { color: var(--surface); }
button.small.ghost { color: var(--accent); background: transparent; }
.sslbox { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }

.sortbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; font-weight: 600; }
.sortbtn::after { content: " \2195"; opacity: 0.35; }
th[data-dir="asc"] .sortbtn::after { content: " \2191"; opacity: 1; }
th[data-dir="desc"] .sortbtn::after { content: " \2193"; opacity: 1; }
.sortbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* scelta dell'aspetto */
.themeform { display: grid; gap: 12px; }
.themes { display: flex; flex-wrap: wrap; gap: 10px; }
.theme { display: grid; justify-items: center; gap: 4px; font-size: 13px; cursor: pointer; padding: 8px; border: 2px solid var(--line); border-radius: 12px; min-width: 92px; background: var(--surface); }
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme:has(input:checked) { border-color: var(--accent); }
.theme:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme .sw { width: 72px; height: 44px; border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.theme .sw i { display: block; width: 24px; height: 18px; border-radius: 4px; }
.custom-colors { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 13px; }
.custom-colors label { display: flex; align-items: center; gap: 6px; }
.custom-colors input[type=color] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.themeform button { justify-self: start; }

/* pulsanti-link dentro le schede: testo leggibile (prima prendevano il colore dei link) */
.card a.btn { color: var(--on-accent, #fff); }
.card a.btn.ghost { color: var(--accent); }
/* collaboratori e permessi */
.tag.staff { border-color: var(--accent); color: var(--accent); }
details.collab { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--surface); }
details.collab > summary { cursor: pointer; list-style: revert; line-height: 1.5; }
details.collab[open] > summary { margin-bottom: 10px; }
fieldset.perms { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
fieldset.perms legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
label.chk { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; font-weight: 400; }
label.chk input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.permform select { width: 100%; }
label.chk { color: var(--ink); font-size: 14px; }
.permform select { font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
/* menu "a panino" in alto a destra */
.sitebar nav { flex-wrap: nowrap; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { border-color: var(--accent); }
details.menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.burger { display: grid; gap: 4px; }
.burger i { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .15s, opacity .15s; }
details.menu[open] .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
details.menu[open] .burger i:nth-child(2) { opacity: 0; }
details.menu[open] .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menupanel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.menupanel a, .menupanel .linkbtn { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; font-size: 15px; }
.menupanel a:hover, .menupanel .linkbtn:hover { background: var(--accent-soft); }
.menupanel form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
/* collegamento a Google Drive */
.upl .drive { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.upl .drive h4 { margin: 0; font-size: 14px; }
.upl .drive .form { gap: 8px; }
.upl .drive input, .upl .drive select { font-size: 14px; }
