/* =========================================================
   Pannello del proprietario e dell'amministratore
   ========================================================= */

@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dm-serif-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #16202C;
  --muted: #5D6877;
  --line: #E0E4EA;
  --line-strong: #C9D0DA;
  --primary: #1F4FB0;
  --primary-soft: #E8EEFA;
  --accent: #E3B23C;
  --ok: #1F7A4A;
  --ok-soft: #E4F3EA;
  --warn: #9A6500;
  --warn-soft: #FBF1DB;
  --danger: #B42318;
  --danger-soft: #FCE9E7;
  --radius: 14px;
  --tabbar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 "Figtree", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: .88rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Struttura ---------- */

.panel.has-tabs { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
.page { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }

.admin-strip {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 8px 16px; background: var(--ink); color: #fff; font-size: .88rem;
}
.admin-strip a { color: #fff; font-weight: 600; }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; margin-right: auto; }
.brand-mark-sm svg { width: 32px; height: 32px; }
.topbar-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout { margin: 0; }
.tabs-desktop { display: none; gap: 4px; }
.tabs-desktop a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs-desktop a[aria-current] { color: var(--primary); background: var(--primary-soft); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .74rem; font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--primary); }

@media (min-width: 860px) {
  .tabs-desktop { display: flex; }
  .tabbar { display: none; }
  .panel.has-tabs { padding-bottom: 0; }
  .page { padding-top: 28px; }
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 2rem; letter-spacing: 0; }
.page-head p { margin-top: 4px; }
.back { display: inline-block; margin-bottom: 6px; font-weight: 600; text-decoration: none; }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-dashed { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--line-strong); border: 0; outline-offset: 2px; }
.btn-dashed { background-image: none; border: 1.5px dashed var(--line-strong); box-shadow: none; }
.btn-small { min-height: 38px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger, .danger { color: var(--danger); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Messaggi e badge ---------- */

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--muted); vertical-align: middle; }
.badge-accent { background: #FBF0D2; color: #7A5600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Card e moduli ---------- */

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: 0 0 0 1px var(--line); }
.card-title { font-size: 1.05rem; font-weight: 700; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-grid + .card, .form-grid + .secondary-actions { margin-top: 14px; }
.card + .card, .two-col + .card, .card + .two-col { margin-top: 14px; }
.two-col { display: grid; gap: 14px; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend, .label { font-weight: 600; font-size: .95rem; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=time] { width: auto; }
input[type=color] { width: 56px; height: 42px; padding: 2px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.input-short { max-width: 180px; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 400; display: block; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

.translations { border-radius: 10px; background: var(--bg); padding: 0 12px; }
.translations summary { cursor: pointer; padding: 10px 0; font-size: .9rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.translations[open] { padding-bottom: 12px; }
.tr-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; margin-top: 8px; }
.tr-lang { font-size: .78rem; font-weight: 700; color: var(--muted); padding-top: 13px; }

.money { position: relative; display: flex; align-items: center; }
.money span { position: absolute; left: 12px; color: var(--muted); font-weight: 600; pointer-events: none; }
.money input { padding-left: 28px; font-variant-numeric: tabular-nums; font-weight: 600; }
.price-row { display: grid; grid-template-columns: 1fr 120px 38px; gap: 8px; align-items: center; }
.price-row + .price-row { margin-top: 8px; }
.prices .price-row:only-child [data-remove-price] { visibility: hidden; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip input { position: absolute; opacity: 0; pointer-events: none; }
.pchip > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: .92rem; font-weight: 500; user-select: none;
}
.pchip b { font-size: .75rem; color: var(--muted); }
.pchip input:checked + span { background: var(--primary); color: #fff; box-shadow: none; }
.pchip input:checked + span b { color: #fff; opacity: .8; }
.pchip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.pchip input:disabled + span { cursor: default; opacity: .8; }

.toggle { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); position: relative; transition: background .15s; margin-top: 1px; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--primary); }
.toggle input:checked + .toggle-ui::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.toggle strong { display: block; }

.photo-field { display: flex; gap: 14px; align-items: center; }
.photo-preview { width: 112px; height: 84px; flex: none; border-radius: 10px; background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .8rem; text-align: center; box-shadow: inset 0 0 0 1.5px var(--line); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-round { width: 84px; border-radius: 50%; }
.photo-preview-round img { object-fit: contain; background: #fff; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.drink-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.drink-details[open] summary { margin-bottom: 14px; }

.actions-row { display: flex; gap: 10px; justify-content: flex-end; }
.actions-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.sticky-actions {
  position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  margin: 0 -16px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.sticky-actions .btn { flex: 1 1 auto; }
@media (min-width: 860px) { .sticky-actions { bottom: 0; } .sticky-actions .btn { flex: 0 0 auto; } }
.secondary-actions { display: flex; justify-content: space-between; gap: 16px; padding: 4px 2px; }
.danger-zone { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Catalogo ---------- */

.seg { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg-add {
  flex: none; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem;
  color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
}
.seg a[aria-current] { background: var(--ink); color: #fff; box-shadow: none; }
.seg a[aria-current] .badge { background: rgba(255,255,255,.18); color: #fff; }
.seg-add { border: 0; cursor: pointer; color: var(--primary); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); border-style: dashed; }

.menu-settings { margin-bottom: 14px; padding: 0; }
.menu-settings > summary { list-style: none; padding: 14px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.menu-settings > summary::-webkit-details-marker { display: none; }
.menu-settings > summary .summary-title { font-weight: 700; display: flex; justify-content: space-between; }
.menu-settings > summary .summary-title::after { content: "Modifica"; color: var(--primary); font-weight: 600; font-size: .9rem; }
.menu-settings[open] > summary .summary-title::after { content: "Chiudi"; }
.menu-settings > form, .menu-settings > .danger-zone { padding: 0 18px; }
.menu-settings > .danger-zone { padding-bottom: 14px; margin-top: 4px; }
.menu-settings[open] > form { padding-top: 4px; }

.cat-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin-bottom: 14px; overflow: hidden; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 14px 10px 18px; }
.cat-head h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 1.45rem; }
.cat-tools { display: flex; align-items: center; gap: 6px; }

.prows { list-style: none; margin: 0; padding: 0; }
.prow { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-top: 1px solid var(--line); }
.prow-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: inherit; }
.prow-thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; }
.prow-initial { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-family: "DM Serif Display", Georgia, serif; font-size: 1.3rem; }
.prow-text { min-width: 0; display: flex; flex-direction: column; }
.prow-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-meta { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.prow.is-soldout .prow-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.prow.is-hidden .prow-link { opacity: .55; }
.prow-move { display: flex; gap: 4px; }

.soldout-form { margin: 0; }
.prow-switches { display: flex; gap: 4px; flex: none; }
.switch { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 2px; cursor: pointer; }
.switch-track { width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] .switch-track { background: var(--danger); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }
.switch-label { font-size: .68rem; font-weight: 700; color: var(--muted); }
.switch[aria-checked="true"] .switch-label { color: var(--danger); }
.switch.is-busy { opacity: .5; }

.reorder-only { display: none; }
.is-reordering .reorder-only { display: flex; gap: 4px; }
.is-reordering .not-reorder { display: none; }
.is-reordering .prow-link { pointer-events: none; }

.add-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); font-weight: 700; text-decoration: none; color: var(--primary); }
.add-row svg { width: 20px; height: 20px; }
.is-reordering .add-row { display: none; }

.empty { text-align: center; padding: 36px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty p { margin: 0; color: var(--muted); max-width: 40ch; }

/* ---------- Finestre ---------- */

.modal { border: 0; border-radius: 18px; padding: 22px 20px; width: min(520px, calc(100% - 24px)); max-height: 88vh; color: var(--ink); background: var(--surface); }
.modal::backdrop { background: rgba(16, 22, 32, .5); }
.modal h2 { font-size: 1.3rem; }

/* ---------- Impostazioni ---------- */

.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-option input { position: absolute; opacity: 0; }
.theme-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); height: 100%; }
.theme-option input:checked + .theme-card { box-shadow: inset 0 0 0 2.5px var(--primary); background: var(--primary-soft); }
.theme-option input:focus-visible + .theme-card { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.theme-swatch { height: 56px; border-radius: 8px; margin-bottom: 6px; display: flex; align-items: flex-end; gap: 6px; padding: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.theme-swatch span { width: 22px; height: 22px; border-radius: 50%; }

/* ---------- QR ---------- */

.qr-layout { display: grid; gap: 14px; }
@media (min-width: 760px) { .qr-layout { grid-template-columns: 320px 1fr; align-items: start; } }
.qr-card { display: flex; flex-direction: column; gap: 14px; }
.qr-box { background: #fff; border-radius: 12px; padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-url { display: flex; gap: 8px; }
.qr-url input { font-size: .88rem; min-width: 0; }

.qr-print { display: none; }
@media print {
  body.printing-cards > *:not(.page) { display: none !important; }
  body.printing-cards .page > *:not(.qr-print) { display: none !important; }
  body.printing-cards .page { padding: 0; max-width: none; }
  body.printing-cards { background: #fff; padding: 0 !important; }
  body.printing-cards .qr-print { display: grid !important; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; width: 210mm; height: 297mm; }
  .table-card { border: 1px dashed #bbb; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10mm; }
  .tc-name { font-family: "DM Serif Display", Georgia, serif; font-size: 20pt; margin: 0 0 5mm; }
  .tc-qr { width: 55mm; }
  .tc-qr svg { width: 100%; height: auto; }
  .tc-cta { font-weight: 700; font-size: 13pt; margin: 5mm 0 1mm; }
  .tc-langs { font-size: 8pt; color: #555; margin: 0; }
  @page { size: A4; margin: 0; }
}

/* ---------- Statistiche ---------- */

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; }
.kpi-label { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kpi-value { font-family: "DM Serif Display", Georgia, serif; font-size: 2.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-unit { color: var(--muted); font-size: .85rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; margin-top: 16px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar span { width: 100%; min-height: 2px; background: var(--primary); border-radius: 3px 3px 0 0; }
.bar.is-sunday span { background: var(--accent); }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.rank { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 40px; gap: 10px; align-items: center; font-size: .92rem; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rank-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.rank-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Amministrazione ---------- */

.venue-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.venue-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; }
.venue-item h2 { font-size: 1.15rem; }
.venue-item p { margin: 2px 0 0; }
.venue-item.is-off { opacity: .7; }
.venue-actions { display: flex; align-items: center; gap: 8px; }
.venue-actions form { margin: 0; }

/* ---------- Accesso ---------- */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 32px 24px; box-shadow: 0 0 0 1px var(--line); }
.brand-mark svg { width: 48px; height: 48px; }
.auth-title { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 2rem; margin: 18px 0 6px; }
.auth-sub { margin: 0 0 20px; color: var(--muted); }
.auth-foot { margin: 18px 0 0; color: var(--muted); font-size: .88rem; }
.error-code { margin: 0; font-weight: 700; color: var(--primary); font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Le card dentro griglie non prendono il margine delle card impilate */
.kpis > .card, .two-col > .card, .qr-layout > .card { margin-top: 0; }

/* ---------- Abbonamenti ---------- */

.badge.state-attivo, .badge.state-omaggio { background: var(--ok-soft); color: var(--ok); }
.badge.state-in_scadenza { background: var(--warn-soft); color: var(--warn); }
.badge.state-scaduto { background: #FDE7D2; color: #9A3F00; }
.badge.state-pausa, .badge.state-sospeso { background: var(--danger-soft); color: var(--danger); }

.sub-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; border-left: 4px solid;
}
.sub-banner p { margin: 0; font-weight: 500; flex: 1 1 260px; }
.sub-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-info { background: var(--primary-soft); border-color: var(--primary); }
.sub-warn { background: var(--warn-soft); border-color: #D69A1F; }
.sub-danger { background: var(--danger-soft); border-color: var(--danger); }

.subscription { margin-bottom: 14px; }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sub-plan { margin: 2px 0 0; font-family: "DM Serif Display", Georgia, serif; font-size: 1.6rem; line-height: 1.15; }
.sub-plan .muted { font-family: "Figtree", system-ui, sans-serif; font-size: .95rem; }
.subscription p { margin: 0; }
.payments summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.payments ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.payments li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; }

.locked {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg); border: 1.5px dashed var(--line-strong); font-size: .92rem;
}
.locked span { color: var(--muted); }
.locked-page p { max-width: 46ch; }

.section-title { font-size: 1.05rem; margin: 22px 0 10px; }
.follow { margin-bottom: 6px; }
.follow-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.follow-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 12px 12px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.follow-item:first-child { border-top: 0; }
.state-row-in_scadenza { border-left-color: #D69A1F; }
.state-row-scaduto { border-left-color: #E07A1F; }
.state-row-pausa { border-left-color: var(--danger); }
.follow-main { display: flex; flex-direction: column; min-width: 0; }
.follow-actions { display: flex; gap: 8px; }

.pay-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.pay-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.pay-list li:first-child { border-top: 0; }
.pay-list li > div { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

.advanced { margin-top: 14px; }
.advanced > summary { cursor: pointer; font-weight: 700; }
.advanced[open] > summary { margin-bottom: 14px; }
input[type=date] { min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); }

/* Copertina: anteprima 2:1 da trascinare, identica al menu */
.two-col > .field-cover { grid-column: 1 / -1; }
.cover-frame { position: relative; width: 100%; max-width: 520px; aspect-ratio: 2 / 1; border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; color: var(--muted); font-size: .9rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.cover-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: grab; pointer-events: none; }
.cover-frame.has-img { cursor: grab; }
.cover-frame.is-dragging { cursor: grabbing; }
.cover-grab { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; pointer-events: none; transition: opacity .2s; display: none; }
.cover-frame.has-img .cover-grab { display: block; }
.cover-frame.is-dragging .cover-grab { opacity: 0; }
.cover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }

/* Interruttore Novità: ambra, per non confonderlo con Esaurito (rosso) */
.switch.switch-new[aria-checked="true"] .switch-track { background: #D99A00; }
.switch.switch-new[aria-checked="true"] .switch-label { color: #8A6100; }

/* Food cost: colonna Costo accanto al prezzo e risultato sotto la riga */
.prices.has-cost .price-row, .price-head { display: grid; grid-template-columns: minmax(0, 1fr) 112px 112px 38px; gap: 8px; align-items: center; }
.price-head { margin-bottom: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.money-cost span { font-size: .74rem; font-weight: 600; }
.money-cost input { font-weight: 500; background: var(--bg); padding-left: 60px; }
.price-fc { grid-column: 1 / -1; margin: -2px 0 0; font-size: .82rem; font-weight: 600; color: var(--muted); }
.price-fc:empty { display: none; }
.price-fc.is-ok { color: var(--ok); }
.price-fc.is-warn { color: var(--warn); }
.price-fc.is-danger { color: var(--danger); }
.badge-fc { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .prices.has-cost .price-row { grid-template-columns: 1fr 1fr 38px; }
  .prices.has-cost .price-row > input[name="price_label[]"] { grid-column: 1 / -1; }
  .price-head { display: none; }
  .money-cost input::placeholder { color: var(--muted); }
}

/* Sconto riservato (admin) */
.discount-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pct-input { position: relative; width: 110px; }
.pct-input input { width: 100%; padding-right: 30px; font-weight: 600; }
.pct-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

/* Garanzia soddisfatti o rimborsati (admin) */
.guarantee.is-active { box-shadow: inset 4px 0 0 var(--ok); }
.danger-outline { color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }

/* Ritocco prezzi in blocco */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pct-wide { width: 140px; }
.bulk-summary { margin: 4px 0 8px; font-weight: 700; }
.bulk-table-wrap { max-height: 420px; overflow: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.bulk-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bulk-table th, .bulk-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.bulk-table thead th { position: sticky; top: 0; background: var(--white, #fff); font-size: .8rem; color: var(--muted); }
.bulk-table td:nth-child(2), .bulk-table td:nth-child(3), .bulk-table thead th:nth-child(2), .bulk-table thead th:nth-child(3) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk-table .bulk-cat th { background: var(--bg); font-size: .8rem; color: var(--muted); }
.bulk-table td.up { color: var(--danger); font-weight: 700; }
.bulk-table td.down { color: var(--ok); font-weight: 700; }
.undo-card { box-shadow: inset 4px 0 0 var(--warn); }
