/* Backoffice mybd: strumento di lavoro, chiaro e denso. Un solo tema, colori espliciti. */
:root {
  --bg: #f2f4f5; --panel: #ffffff; --ink: #16242e; --muted: #5d6c76; --line: #dde3e7; --soft: #eef2f4;
  --brand: #0b3c5d; --accent: #e5533a; --ok: #13805b; --warn: #a86400; --bad: #b42318;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; --display: "Bricolage Grotesque", var(--sans);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.45 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--brand); color: #fff; }
.top b { font: 800 18px var(--display); letter-spacing: -.01em; }
.top b span { opacity: .6; font-weight: 700; }
.top button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 54px); }
.side { border-right: 1px solid var(--line); background: var(--panel); padding: 16px; display: grid; align-content: start; gap: 14px; }
.side h2 { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tlist { display: grid; gap: 4px; }
.tlist button { all: unset; cursor: pointer; display: grid; gap: 1px; padding: 9px 10px; border-radius: 9px; }
.tlist button:hover { background: var(--soft); }
.tlist button[aria-current="true"] { background: var(--brand); color: #fff; }
.tlist button small { color: var(--muted); font-size: 12px; }
.tlist button[aria-current="true"] small { color: rgba(255,255,255,.75); }
.main { padding: 20px 24px 60px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.head h1 { margin: 0; font: 800 26px/1.1 var(--display); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { all: unset; cursor: pointer; padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel h3 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.f { display: grid; gap: 5px; min-width: 0; }
.f > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.f input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=time]), .f select, .f textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.f textarea { min-height: 70px; resize: vertical; }
.f.wide { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: progress; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.tag.ok { background: #e3f4ec; color: var(--ok); }
.tag.off { background: #fbeae8; color: var(--bad); }
.tag.warn { background: #fdf1df; color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tablewrap { overflow-x: auto; }
.items { display: grid; }
.item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; }
.item .tx small { color: var(--muted); }
.flash { position: fixed; right: 18px; bottom: 18px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; z-index: 50; max-width: 420px; }
.flash.bad { background: var(--bad); }
.result { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* Colori */
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.color { display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.color[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11,60,93,.15); }
.color input[type=color] { width: 44px; height: 44px; border: 0; padding: 0; background: none; grid-row: span 2; cursor: pointer; }
.color input[type=text] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; font-family: ui-monospace, Menlo, monospace; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; }
.media { display: flex; gap: 16px; flex-wrap: wrap; }
.media figure { margin: 0; display: grid; gap: 6px; }
.media img { max-height: 90px; max-width: 220px; border-radius: 8px; border: 1px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 / 14px 14px; }
.appearance { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

/* Anteprima del telefono */
.preview { position: sticky; top: 16px; border-radius: 30px; padding: 8px; background: #111; }
.pv { border-radius: 23px; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Figtree", sans-serif; }
.pv-hero { position: relative; padding: 18px 16px 64px; color: var(--on-hero); background: linear-gradient(170deg, var(--hero-from), var(--accent) 48%, var(--hero-to)); overflow: hidden; }
.pv-hero.photo { background: var(--primary) center / cover; color: #fff; }
.pv-hero::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -1px; height: 46px; background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.pv-sun { position: absolute; right: -24px; top: 16px; width: 92px; height: 92px; border-radius: 50%; background: var(--highlight); }
.pv-hero small { position: relative; font-weight: 700; font-size: 11px; }
.pv-hero b { position: relative; display: block; font: 800 24px/1 var(--display); margin-top: 6px; max-width: 10ch; }
.pv-logo { position: relative; height: 26px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 2px 5px; }
.pv-stay { margin: -44px 12px 0; position: relative; background: #fff; border-radius: 16px; padding: 10px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 20px -14px rgba(0,0,0,.5); }
.pv-room { width: 52px; height: 52px; border-radius: 13px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 800 18px var(--display); }
.pv-stay span { font-size: 12px; color: var(--muted); }
.pv-pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--highlight-soft); margin-top: 3px; }
.pv-next { margin: 14px 12px 0; padding: 11px; border-radius: 14px; background: var(--primary); color: var(--on-primary); }
.pv-next small { color: var(--highlight); font-weight: 800; font-size: 10px; letter-spacing: .08em; }
.pv-next b { display: block; font: 800 16px var(--display); }
.pv-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 12px; }
.pv-quick div { border-radius: 12px; padding: 10px; font-weight: 700; font-size: 12px; }
.pv-nav { margin: 6px 12px 12px; height: 40px; border-radius: 14px; background: var(--primary); color: var(--on-primary); display: flex; justify-content: space-around; align-items: center; font-size: 10px; font-weight: 700; }
.pv-nav span:first-child { color: var(--highlight); }
.pv-btn { margin: 0 12px 12px; padding: 10px; border-radius: 12px; background: var(--accent); color: var(--on-accent); text-align: center; font-weight: 800; font-size: 13px; }
.contrast { font-size: 12.5px; color: var(--muted); }

/* Dialog */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(10,20,30,.45); }
dialog form { display: grid; gap: 14px; padding: 18px; }
dialog h3 { margin: 0; font: 800 20px var(--display); }
.ltabs { display: flex; gap: 4px; }
.ltabs button { all: unset; cursor: pointer; padding: 5px 10px; border-radius: 7px; font-weight: 700; font-size: 12.5px; background: var(--soft); }
.ltabs button[aria-selected="true"] { background: var(--brand); color: #fff; }
.slot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; background: var(--soft); border-radius: 8px; }
.slot input[type=time] { padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; }
.days label { display: inline-flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700; gap: 2px; }

.login { max-width: 360px; margin: 12vh auto; padding: 24px; background: var(--panel); border-radius: 14px; border: 1px solid var(--line); display: grid; gap: 14px; }
.login h1 { margin: 0; font: 800 26px var(--display); }
.err { color: var(--bad); font-weight: 600; margin: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .appearance { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 320px; }
}

/* Luoghi */
.vgroup { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vthumb { width: 56px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: linear-gradient(135deg, var(--soft), var(--line)); }
.vslot { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.vphotos { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.vphotos figure { margin: 0; display: grid; gap: 4px; justify-items: start; }
.vphotos img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.vphotos span { display: flex; gap: 4px; align-items: center; }
