/* Backoffice Skesite: tema neutro, leggibile da chi non programma. */
:root {
  --ink: #1d1d1f;
  --muted: #68686e;
  --line: #e2e2e5;
  --bg: #f5f5f6;
  --card: #fff;
  --accent: #1d1d1f;
  --ok-bg: #e7f4ea; --ok-ink: #1c5c2c;
  --err-bg: #fbe9e7; --err-ink: #8c2318;
  --info-bg: #eef2f8; --info-ink: #24406b;
  --warn-bg: #fff6da; --warn-ink: #5a4a10;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bo-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; padding: .75rem clamp(16px, 3vw, 32px); background: var(--card); border-bottom: 1px solid var(--line); }
.bo-brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.bo-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
.bo-nav a { text-decoration: none; }
.bo-nav a:hover { text-decoration: underline; }
.bo-nav form { margin: 0; }
.bo-main { max-width: 1040px; margin: 0 auto; padding: clamp(16px, 3vw, 32px); }

.bo-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.bo-head p { color: var(--muted); margin: 0; }
.bo-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 24px); margin-bottom: 1rem; }
.bo-card--narrow { max-width: 440px; margin-inline: auto; }
.bo-muted { color: var(--muted); font-size: .9rem; }
.bo-strong { font-weight: 600; }

.bo-btn { display: inline-block; min-height: 42px; padding: .55rem 1.1rem; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.bo-btn:hover { opacity: .88; }
.bo-btn--ghost { background: transparent; color: var(--accent); }
.bo-link { padding: 0; background: none; border: 0; font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; color: inherit; }
.bo-link--danger { color: var(--err-ink); }

input, select, textarea { width: 100%; min-height: 42px; padding: .5rem .7rem; background: #fff; color: var(--ink); border: 1px solid #c9c9ce; border-radius: var(--radius); font: inherit; }
.bo-form { display: grid; gap: 1rem; margin-top: 1rem; }
.bo-form label { display: grid; gap: .3rem; font-weight: 500; }
.bo-form small { color: var(--muted); font-weight: 400; }
.bo-inline { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.bo-inline input, .bo-inline select { flex: 1 1 200px; width: auto; }

.bo-flash { padding: .65rem .9rem; border-radius: var(--radius); }
.bo-flash--success { background: var(--ok-bg); color: var(--ok-ink); }
.bo-flash--error { background: var(--err-bg); color: var(--err-ink); }
.bo-flash--info { background: var(--info-bg); color: var(--info-ink); }
.bo-flash--secret { background: var(--warn-bg); color: var(--warn-ink); font-weight: 500; overflow-wrap: anywhere; }

.bo-badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; background: var(--bg); font-size: .8rem; font-weight: 500; white-space: nowrap; }
.bo-badge--online { background: var(--ok-bg); color: var(--ok-ink); }
.bo-badge--draft { background: var(--warn-bg); color: var(--warn-ink); }
.bo-badge--suspended { background: var(--err-bg); color: var(--err-ink); }

.bo-rows { list-style: none; margin: .5rem 0 0; padding: 0; }
.bo-rows li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.bo-rows li:first-child { border-top: 0; }
.bo-rows form { margin: 0; }

.bo-search { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.bo-search input { flex: 2 1 220px; width: auto; }
.bo-search select { flex: 1 1 160px; width: auto; }
.bo-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.bo-table { width: 100%; border-collapse: collapse; }
.bo-table th, .bo-table td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bo-table th { font-size: .85rem; font-weight: 600; color: var(--muted); }
.bo-table th a { text-decoration: none; }
.bo-table tr:last-child td { border-bottom: 0; }
.bo-empty { color: var(--muted); text-align: center; }
.bo-pages { display: flex; justify-content: center; gap: 1rem; padding: 1rem; }
/* ---------- Area di lavoro del negozio ---------- */
.bo-workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.bo-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 1.25rem .75rem; min-height: calc(100vh - 60px); background: var(--card); border-right: 1px solid var(--line); }
.bo-side__site { padding: 0 .6rem .75rem; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.bo-side a { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; border-radius: var(--radius); text-decoration: none; }
.bo-side a:hover { background: var(--bg); }
.bo-side a[aria-current] { background: var(--accent); color: #fff; }
.bo-side__out { margin-top: .75rem; color: var(--muted); }
.bo-count { min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--warn-bg); color: var(--warn-ink); font-size: .78rem; text-align: center; }
.bo-main--work { max-width: 960px; margin: 0; width: 100%; }

.bo-form--wide { margin-top: 0; }
.bo-form--wide .bo-card { display: grid; gap: 1rem; margin-bottom: 0; }
.bo-form--wide .bo-card > h2, .bo-form--wide .bo-card > p { margin-bottom: -.5rem; }
.bo-field { display: grid; gap: .3rem; font-weight: 500; align-content: start; }
.bo-field small, .bo-check small { display: block; color: var(--muted); font-weight: 400; }
.bo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.bo-i18n { display: grid; gap: 1rem; }
.bo-i18n--two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bo-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.bo-check input { width: 1.15rem; min-height: 0; height: 1.15rem; margin-top: .2rem; flex: none; }
.bo-savebar { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
.bo-danger { margin-top: 1.5rem; }
.bo-fieldset { display: grid; gap: .75rem; padding: 1rem; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.bo-fieldset legend { padding: 0 .4rem; font-weight: 600; }

.bo-mediafield__box { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.bo-mediafield__thumb { display: block; width: 88px; height: 88px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.bo-mediafield__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-gallery { display: grid; gap: .75rem; justify-items: start; }
.bo-gallery__items { display: flex; flex-wrap: wrap; gap: .75rem; }
.bo-gallery__item { display: grid; gap: .3rem; width: 120px; font-size: .85rem; }
.bo-gallery__item img { width: 120px; height: 120px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); }
.bo-gallery__item:first-child img { outline: 2px solid var(--accent); outline-offset: 1px; }

.bo-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.bo-thumb { position: relative; display: block; padding: 0; aspect-ratio: 1; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.bo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-thumb:hover { border-color: var(--accent); }
.bo-thumb__warn { position: absolute; left: 4px; bottom: 4px; padding: 0 .35rem; border-radius: 4px; background: var(--warn-bg); color: var(--warn-ink); font-size: .72rem; }
.bo-upload { position: relative; display: inline-block; overflow: hidden; cursor: pointer; }
.bo-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bo-dialog { width: min(760px, 92vw); max-height: 86vh; padding: 1.25rem; border: 0; border-radius: var(--radius); }
.bo-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.bo-dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.bo-dialog__head h2 { margin: 0; }
.bo-dialog .bo-thumbs { margin-top: .75rem; }

.bo-focal { position: relative; display: inline-block; max-width: 100%; line-height: 0; cursor: crosshair; }
.bo-focal img { max-width: 100%; max-height: 520px; border-radius: var(--radius); }
.bo-focal__dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); pointer-events: none; }

.bo-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.bo-tabs a { padding: .4rem .9rem; border-radius: var(--radius); text-decoration: none; }
.bo-tabs a[aria-current] { background: var(--accent); color: #fff; }
.bo-blocks li { align-items: center; }
.bo-blocks li.is-off .bo-blocks__main { opacity: .55; }
.bo-blocks__main { display: grid; flex: 1 1 240px; }
.bo-blocks__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
.bo-swatches { display: flex; flex-wrap: wrap; gap: .75rem; }
.bo-swatch { display: grid; gap: .35rem; justify-items: center; padding: .75rem; min-width: 100px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.bo-swatch--wide { flex: 1 1 240px; }
.bo-swatch:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bo-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.bo-swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bo-swatch__color { width: 44px; height: 44px; border-radius: 50%; }
.bo-fontsample { font-size: 1.3rem; text-align: center; }
.bo-mini { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.bo-mini--empty { background: var(--bg); }
.bo-wrap { display: inline-block; max-width: 340px; white-space: normal; }
.bo-table td form { margin: 0 0 .25rem; }
.bo-table-wrap--plain { border: 0; }
.bo-hours th, .bo-hours td { padding: .3rem .4rem; }
.bo-hours input { min-width: 96px; }

@media (max-width: 760px) {
  .bo-workspace { grid-template-columns: minmax(0, 1fr); }
  .bo-side { position: static; flex-direction: row; flex-wrap: wrap; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .bo-side__site { width: 100%; }
  .bo-side__out { margin-top: 0; }
}

/* Le regole .bo-form label valgono per i campi, non per spunte e campioni. */
.bo-form label.bo-check { display: flex; gap: .6rem; align-items: flex-start; }
.bo-form label.bo-field { display: grid; }
.bo-form label.bo-swatch { display: grid; gap: .35rem; justify-items: center; }
input, select, textarea { font-weight: 400; }
.bo-nav .bo-link { text-decoration: none; }
.bo-nav .bo-link:hover { text-decoration: underline; }

.bo-focal { display: block; width: min(100%, 460px); justify-self: start; }
.bo-focal img { display: block; width: 100%; height: auto; max-height: none; }
.bo-below { margin: 1rem 0 0; font-size: .92rem; }
.bo-card .bo-form + p { margin-top: 1rem; }
.bo-texts summary { cursor: pointer; font-weight: 500; }
.bo-texts[open] summary { margin-bottom: 1rem; }
.bo-texts .bo-i18n + .bo-i18n { margin-top: .9rem; }

.bo-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.bo-import-help { margin-top: 1rem; }
.bo-import-help summary { cursor: pointer; font-weight: 500; }
.bo-import-help ul { margin: .6rem 0 0; padding-left: 1.2rem; }
.bo-table--wrap td { white-space: normal; }
