/* Pannello di controllo */
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root { --f: #f4f2ee; --c: #fff; --t: #22201c; --t2: #6c665d; --b: #e3ded5; --a: #ff9a1a; --a2: #e07000; --scuro: #16181b; --verde: #1f9d55; --rosso: #d23b2a; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--f); color: var(--t); font: 400 16px/1.5 'Barlow', 'Segoe UI', system-ui, sans-serif; }
h1, h2 { font-family: 'Barlow Condensed', sans-serif; margin: 0 0 12px; }
h2 { font-size: 1.45rem; }
a { color: #b25600; }
code { background: #eee9e0; padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.pannello { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.lato { background: var(--scuro); color: #ddd; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.lato-marchio { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; padding: 4px 10px 20px; line-height: 1.1; font-size: .9rem; }
.lato-marchio b { color: var(--a); font-family: 'Barlow Condensed'; font-size: 1.3rem; }
.lato nav { display: grid; gap: 2px; }
.lato nav a { display: flex; align-items: center; gap: 12px; color: #c9c4bb; text-decoration: none; padding: 11px 12px; border-radius: 9px; }
.lato nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.lato nav a[aria-current] { background: rgba(255, 154, 26, .16); color: #fff; box-shadow: inset 3px 0 0 var(--a); }
.lato svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lato-piede { margin-top: auto; display: grid; gap: 4px; padding: 10px; border-top: 1px solid rgba(255, 255, 255, .1); }
.lato-piede a { color: #aaa; text-decoration: none; padding: 6px 2px; }
.lato-piede a:hover { color: #fff; }
.area { min-width: 0; }
.area-testa { display: flex; align-items: center; gap: 14px; padding: 22px 32px 6px; }
.area-testa h1 { font-size: 2rem; margin: 0; }
.menu-lato { display: none; }
.area-corpo { padding: 14px 32px 60px; max-width: 1180px; }
.msg { padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; border: 1px solid; }
.msg.ok { background: #e8f6ee; border-color: #b4e0c6; color: #145c33; }
.msg.errore { background: #fdecea; border-color: #f3b9b1; color: #8a2216; }
.msg.avviso { background: #fff4e3; border-color: #ffd49a; color: #7a4300; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(#ffb547, var(--a)); color: #1d1205; font: 600 15px/1 'Barlow', sans-serif; border: 1px solid #e58a10; padding: 11px 16px; border-radius: 9px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondario { background: #fff; border-color: var(--b); color: var(--t); }
.btn.secondario:hover { border-color: #c9c2b6; }
.btn.piccolo { padding: 6px 10px; font-size: 13px; }
.link, .link-rosso { background: none; border: 0; padding: 0; font: inherit; color: #b25600; cursor: pointer; text-decoration: underline; }
.link-rosso, .rosso { color: var(--rosso); }
.aiuto { color: var(--t2); font-size: .92rem; }
.numeri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.numero { background: var(--c); border: 1px solid var(--b); border-radius: 14px; padding: 18px 20px; display: grid; }
.numero span { color: var(--t2); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.numero b { font: 700 2.4rem/1.1 'Barlow Condensed'; margin: 6px 0 2px; }
.numero small { color: var(--t2); }
.riquadro-a { background: var(--c); border: 1px solid var(--b); border-radius: 14px; padding: 20px 22px; margin: 0 0 18px; }
fieldset.riquadro-a { padding-top: 10px; }
legend { font: 700 1.2rem 'Barlow Condensed'; padding: 0 6px; }
.grafico { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.grafico span { flex: 1; height: max(var(--h), 2px); background: linear-gradient(var(--a), #ffcc80); border-radius: 4px 4px 0 0; }
.azioni-rapide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.azioni-rapide a { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--b); border-radius: 12px; text-decoration: none; color: var(--t); background: #fcfbf9; }
.azioni-rapide a:hover { border-color: var(--a); }
.azioni-rapide span { color: var(--t2); font-size: .92rem; }
.modulo { display: grid; gap: 14px; }
.modulo.largo { max-width: 980px; }
.modulo label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.modulo input:not([type=checkbox]):not([type=file]), .modulo select, .modulo textarea, .cerca-a input {
  font: 400 16px/1.4 'Barlow', sans-serif; padding: 10px 12px; border: 1px solid #d3ccbf; border-radius: 9px; background: #fff; color: var(--t); width: 100%;
}
.modulo input:focus, .modulo select:focus, .modulo textarea:focus { outline: 2px solid var(--a); outline-offset: 0; border-color: var(--a); }
.modulo .spunta, .spunta { display: flex !important; flex-direction: row; gap: 10px; align-items: center; font-weight: 400 !important; }
.spunta input { width: 18px; height: 18px; accent-color: var(--a2); }
.spunta.piccola { font-size: .8rem; }
.due { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.bottoni { display: flex; gap: 10px; flex-wrap: wrap; }
.tabella-a { overflow-x: auto; background: var(--c); border: 1px solid var(--b); border-radius: 14px; margin-bottom: 16px; }
.tabella-a table { width: 100%; border-collapse: collapse; min-width: 640px; }
.tabella-a th, .tabella-a td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #efebe4; vertical-align: top; }
.tabella-a th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--t2); background: #fbfaf7; }
.tabella-a tr:last-child td { border-bottom: 0; }
.tabella-a small { color: var(--t2); }
.vuota { text-align: center; color: var(--t2); padding: 30px !important; }
.azioni { white-space: nowrap; }
.azioni > * { margin-right: 12px; }
.azioni form { display: inline-flex; gap: 8px; align-items: center; }
.stato { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #eee9e0; color: #5b554c; }
.stato.si { background: #e1f4e8; color: #17703d; }
.stato.giallo { background: #fff0d4; color: #8a5300; }
.schede-a { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.schede-a a { padding: 9px 14px; border-radius: 9px; border: 1px solid var(--b); background: #fff; text-decoration: none; color: var(--t); }
.schede-a a[aria-current] { background: var(--scuro); color: #fff; border-color: var(--scuro); }
.schede-a span { background: rgba(0, 0, 0, .08); padding: 1px 7px; border-radius: 99px; font-size: .85rem; margin-left: 4px; }
.schede-a a[aria-current] span { background: rgba(255, 255, 255, .2); }
.cerca-a { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cerca-a input { max-width: 340px; }
/* editor */
.editor { border: 1px solid #d3ccbf; border-radius: 12px; background: #fff; overflow: hidden; }
.editor-barra { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #f8f6f2; border-bottom: 1px solid #e6e0d6; position: sticky; top: 0; z-index: 2; }
.editor-barra button { font: 600 13px 'Barlow', sans-serif; padding: 7px 10px; border: 1px solid #ddd6ca; background: #fff; border-radius: 7px; cursor: pointer; }
.editor-barra button:hover { border-color: var(--a); }
.editor-barra .attivo { background: var(--scuro); color: #fff; }
.editor-spazio { flex: 1; }
.editor textarea { border: 0 !important; border-radius: 0 !important; font: 15px/1.6 ui-monospace, Consolas, monospace !important; padding: 16px !important; resize: vertical; min-height: 260px; }
.editor-anteprima { padding: 20px 26px; background: #121416; color: #ece8e1; }
.editor-aiuto { border-top: 1px solid #eee; padding: 8px 14px; font-size: .9rem; color: var(--t2); }
.editor-aiuto summary { cursor: pointer; font-weight: 600; }
.editor-aiuto p { margin: 6px 0; }
/* anteprima con lo stile del sito */
.testo-anteprima h2 { color: #fff; font: 700 1.8rem 'Barlow Condensed'; margin: 1.4em 0 .5em; }
.testo-anteprima h3 { color: #ffd27a; font: 700 1.35rem 'Barlow Condensed'; margin: 1.2em 0 .4em; }
.testo-anteprima a { color: #ffd27a; }
.testo-anteprima code { background: rgba(255, 255, 255, .1); color: #fff; }
.testo-anteprima kbd { display: inline-block; font: 600 .82em 'Barlow'; padding: .3em .55em; border-radius: 6px; color: #1b1b1b; background: linear-gradient(#fbfaf7, #d8d4cc); border: 1px solid #a8a296; box-shadow: 0 2px 0 #8c867b; }
.testo-anteprima .riquadro { border-radius: 12px; padding: 4px 16px; margin: 1em 0; border: 1px solid rgba(120, 170, 255, .3); background: rgba(120, 170, 255, .08); }
.testo-anteprima .riquadro.avviso { border-color: rgba(255, 165, 31, .4); background: rgba(255, 165, 31, .12); }
.testo-anteprima table { border-collapse: collapse; width: 100%; }
.testo-anteprima th, .testo-anteprima td { border: 1px solid rgba(255, 255, 255, .15); padding: 8px; text-align: left; }
.testo-anteprima img { max-width: 100%; border-radius: 10px; }
.testo-anteprima figcaption { color: #8a847b; font-size: .9rem; text-align: center; }
/* caricamento e invio */
.barra { height: 12px; background: #eee9e0; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.barra.grande { height: 20px; }
.barra span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), #ffcc80); transition: width .3s; }
.carica { border: 2px dashed #d8d0c2; border-radius: 12px; padding: 12px 16px; margin: 6px 0; }
.carica p { margin: 4px 0 8px; }
.carica-esito.ok { color: var(--verde); font-weight: 600; }
.carica-esito.errore { color: var(--rosso); font-weight: 600; }
.manda { border-color: #ffd49a; background: #fffaf2; display: grid; gap: 12px; }
.invio-conta { font-size: 1.2rem; }
.riga-copia { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0ece5; }
.galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.galleria figure { margin: 0; background: #fff; border: 1px solid var(--b); border-radius: 12px; overflow: hidden; }
.galleria img { width: 100%; height: 140px; object-fit: cover; display: block; background: #222; }
.galleria figcaption { font-size: .85rem; padding: 8px 10px 0; word-break: break-all; color: var(--t2); }
.galleria-azioni { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; }
/* accesso e installazione */
body.accesso { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(700px 400px at 50% 0%, rgba(255, 154, 26, .25), transparent), var(--scuro); padding: 16px; }
.accesso-box { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.accesso-box.larga { width: min(560px, 100%); }
.accesso-box h1 { font-size: 1.9rem; margin: 12px 0 18px; }
.accesso-box .piccolo { text-align: center; margin: 16px 0 0; font-size: .9rem; }
.controlli { list-style: none; padding: 0; margin: 0 0 16px; font-size: .95rem; }
.controlli .si { color: var(--verde); } .controlli .no { color: var(--rosso); font-weight: 600; }
@media (max-width: 860px) {
  .pannello { grid-template-columns: 1fr; }
  .lato { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .lato.aperto { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
  .menu-lato { display: block; font-size: 1.4rem; background: #fff; border: 1px solid var(--b); border-radius: 9px; width: 44px; height: 44px; cursor: pointer; }
  .area-testa { padding: 16px; }
  .area-testa h1 { font-size: 1.5rem; }
  .area-corpo { padding: 10px 16px 50px; }
  .numeri, .due { grid-template-columns: 1fr; }
}
