/* =========================================================================
   Portineria — foglio di stile unico, senza build.
   Riferimento visivo: il tableau di una reception. Fondo intonaco, inchiostro
   ardesia, verde persiana per le azioni. Le prenotazioni sono targhette portachiavi.
   ========================================================================= */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-ext-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

:root {
  /* materiali */
  --plaster: #ECEFE8;      /* fondo: intonaco */
  --plaster-deep: #E1E5DC;
  --paper: #FAFBF8;        /* superfici di lavoro */
  --line: #D2D8CC;
  --line-strong: #AEB7A8;
  --ink: #1C292D;          /* ardesia */
  --ink-soft: #46555A;
  --ink-muted: #5B686B;    /* testo secondario, contrasto AA su paper */

  /* azione */
  --shutter: #2A5A4B;      /* verde persiana */
  --shutter-hover: #1F4A3D;
  --shutter-tint: #DCE8E1;

  /* portali (non sono i colori dei marchi) */
  --p-airbnb: #A8374F;     /* lampone */
  --p-booking: #2C57A0;    /* cobalto */
  --p-direct: #5D6E24;     /* oliva */
  --p-vrbo: #6B4F8E;       /* prugna */
  --p-other: #5A6266;

  /* stati */
  --warn-ink: #7E4A00;  --warn-bg: #F7E8C8;
  --danger-ink: #9C2117; --danger-bg: #F6DEDA;
  --ok-ink: #1F4A3D;    --ok-bg: #DCE8E1;

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px #3F7BD9;

  --font-ui: "Atkinson Next", "Segoe UI", system-ui, sans-serif;
  --font-display: "Bricolage", "Atkinson Next", system-ui, sans-serif;

  --step--1: 0.8125rem;   /* 13px: solo metadati */
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 1.85rem;
  --step-4: clamp(2.1rem, 1.5rem + 2.6vw, 3.1rem);

  --page-pad: clamp(1rem, 0.6rem + 2vw, 2.25rem);
  --header-h: 3.75rem;
  --tabbar-h: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font-ui);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--shutter); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--shutter-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
::selection { background: var(--shutter-tint); }

h1, h2, h3 { font-family: var(--font-display); font-stretch: 88%; line-height: 1.12; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: var(--step-3); font-weight: 650; }
h2 { font-size: var(--step-2); font-weight: 620; }
h3 { font-size: var(--step-1); font-weight: 620; font-stretch: 94%; letter-spacing: 0; }
p { margin: 0; }
.muted { color: var(--ink-muted); }
.small { font-size: var(--step--1); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: var(--r-sm); }
.skip-link:focus { top: .75rem; }

.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink); color: #E9EEE7;
}
.site-header__inner {
  height: var(--header-h); display: flex; align-items: center; gap: 2rem;
  padding: 0 var(--page-pad); max-width: 92rem; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font-family: var(--font-display); font-stretch: 80%; font-weight: 680; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand:hover { color: #fff; text-decoration: none; }
.brand__tag { width: 1.6rem; height: 1.6rem; }

.main-nav { display: flex; align-self: stretch; gap: .25rem; }
.main-nav a {
  display: flex; align-items: center; padding: 0 .85rem; color: #C9D3CC; text-decoration: none;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent; font-weight: 500;
}
.main-nav a:hover { color: #fff; }
.main-nav a[aria-current="page"] { color: #fff; border-bottom-color: #8DBFA9; }
.main-nav a:focus-visible { box-shadow: inset 0 0 0 2px #8DBFA9; border-radius: 0; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.account-menu { position: relative; }
.account-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  padding: .35rem .5rem; border-radius: var(--r-sm); color: #DDE5DF;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: #2C3B40; }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: #8DBFA9; color: var(--ink); font-weight: 700; font-size: .85rem;
}
.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 15rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 12px 32px -12px rgba(28, 41, 45, .35); padding: .5rem; z-index: 30;
}
.account-menu__panel p { padding: .5rem .65rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.account-menu__panel a, .account-menu__panel button {
  display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.account-menu__panel a:hover, .account-menu__panel button:hover { background: var(--plaster); }
.account-menu__panel button[disabled] { cursor: default; font-weight: 650; }
.account-menu__panel button[disabled]:hover { background: none; }
.account-menu__switch { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .45rem; }
.account-menu__switch > span { display: block; padding: .2rem .65rem; }

/* ---------------------------------------------------------------- tab bar mobile */
.tabbar { display: none; }

/* ---------------------------------------------------------------- pagina */
.page { max-width: 92rem; margin: 0 auto; padding: 1.75rem var(--page-pad) 4rem; }
.page--narrow { max-width: 56rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.75rem; }
.page-head__text { flex: 1 1 24rem; min-width: 0; }
.page-head__text > * + * { margin-top: .45rem; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); margin-bottom: .6rem; }
.back-link:hover { color: var(--ink); text-decoration: underline; }

.today-date { font-size: var(--step-4); font-stretch: 78%; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.today-date span { display: block; font-size: var(--step-1); font-stretch: 100%; font-family: var(--font-ui); font-weight: 400; letter-spacing: 0; color: var(--ink-soft); margin-top: .75rem; line-height: 1.4; }

.section { margin-top: 2.25rem; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-head h2 { font-size: var(--step-1); font-stretch: 94%; }
.section-head .count { font-family: var(--font-ui); font-weight: 400; color: var(--ink-muted); margin-left: .35rem; }

.columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 1fr); gap: 2rem 2.5rem; align-items: start; }

/* superfici: un solo livello di pannello, il resto è testo su intonaco */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel__body { padding: 1.25rem 1.35rem; }
.panel__body > * + * { margin-top: 1rem; }
.panel + .panel { margin-top: 1.25rem; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); }
.panel-title h2, .panel-title h3 { font-size: var(--step-1); }

/* ---------------------------------------------------------------- liste di righe */
.rows { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 0.45rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .85rem 1.1rem .85rem 0; }
.row__stripe { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--p-other); }
.row__main { min-width: 0; }
.row__title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__title a { color: var(--ink); text-decoration: none; }
.row__title a:hover { text-decoration: underline; }
.row__meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; color: var(--ink-muted); font-size: var(--step--1); margin-top: .15rem; }
.row__side { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.rows--plain .row { grid-template-columns: minmax(0, 1fr) auto; padding-left: 1.1rem; }

.empty { padding: 1.5rem 1.35rem; color: var(--ink-soft); }
.empty--dashed { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: transparent; }

/* ---------------------------------------------------------------- etichette */
.portal { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--step--1); color: var(--ink-soft); white-space: nowrap; }
.portal::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--pc, var(--p-other)); }
.pc-airbnb { --pc: var(--p-airbnb); }
.pc-booking { --pc: var(--p-booking); }
.pc-direct { --pc: var(--p-direct); }
.pc-vrbo { --pc: var(--p-vrbo); }
.pc-channel_manager, .pc-other { --pc: var(--p-other); }
.row__stripe.pc-airbnb, .row__stripe.pc-booking, .row__stripe.pc-direct, .row__stripe.pc-vrbo, .row__stripe.pc-other, .row__stripe.pc-channel_manager { background: var(--pc); }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: var(--step--1); font-weight: 600; white-space: nowrap; line-height: 1.45; }
.pill .icon { width: .95rem; height: .95rem; stroke-width: 2.2; }
.pill--todo { background: var(--warn-bg); color: var(--warn-ink); }
.pill--progress { background: #E2E8EE; color: #29405C; }
.pill--done { background: var(--ok-bg); color: var(--ok-ink); }
.pill--danger { background: var(--danger-bg); color: var(--danger-ink); }
.pill--neutral { background: var(--plaster-deep); color: var(--ink-soft); }

/* ---------------------------------------------------------------- avvisi */
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--r-md); border: 1px solid transparent; }
.notice .icon { margin-top: .1rem; }
.notice__body { flex: 1; min-width: 0; }
.notice__body > * + * { margin-top: .35rem; }
.notice--ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #BFD4C8; }
.notice--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #E9D2A2; }
.notice--danger { background: var(--danger-bg); color: var(--danger-ink); border-color: #EBC2BC; }
.notice--info { background: var(--paper); color: var(--ink); border-color: var(--line); }
.notice a { color: inherit; font-weight: 650; }
.notice ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.notice__close { background: none; border: 0; color: inherit; cursor: pointer; padding: .15rem; border-radius: var(--r-xs); opacity: .75; }
.notice__close:hover { opacity: 1; }
.flash-area { margin-bottom: 1.25rem; }
.flash-area > * + * { margin-top: .6rem; }

/* La scadenza della Questura: l'unico avviso che deve saltare all'occhio */
.deadline { background: var(--ink); color: #F1F4EF; border-radius: var(--r-md); padding: 1.1rem 1.3rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem 1rem; align-items: start; margin-bottom: 2rem; }
.deadline .icon { width: 1.6rem; height: 1.6rem; color: #F2C66D; grid-row: span 2; }
.deadline h2 { font-size: var(--step-1); color: #fff; }
.deadline ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; }
.deadline li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.deadline a { color: #fff; font-weight: 650; }
.deadline .when { color: #F2C66D; font-size: var(--step--1); font-weight: 600; }

/* ---------------------------------------------------------------- pulsanti */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.6rem; padding: .5rem 1rem; border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font: 600 var(--step-0)/1.2 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn:hover { --bg: #fff; --bd: var(--ink-soft); color: var(--fg); text-decoration: none; }
.btn--primary { --bg: var(--shutter); --fg: #fff; --bd: var(--shutter); }
.btn--primary:hover { --bg: var(--shutter-hover); --bd: var(--shutter-hover); }
.btn--quiet { --bg: transparent; --bd: transparent; color: var(--shutter); padding-inline: .6rem; }
.btn--quiet:hover { --bg: var(--shutter-tint); --bd: transparent; }
.btn--danger { --fg: var(--danger-ink); --bd: #D9A7A0; }
.btn--danger:hover { --bg: var(--danger-bg); --bd: var(--danger-ink); }
.btn--small { min-height: 2.1rem; padding: .3rem .7rem; font-size: var(--step--1); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 1.1rem; height: 1.1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.inline-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--shutter); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.link-button--danger { color: var(--danger-ink); }

/* ---------------------------------------------------------------- moduli */
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.1rem 1rem; }
.form-grid > .span-6 { grid-column: span 6; }
.form-grid > .span-4 { grid-column: span 4; }
.form-grid > .span-3 { grid-column: span 3; }
.form-grid > .span-2 { grid-column: span 2; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset + .fieldset { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.fieldset legend { float: left; width: 100%; font-family: var(--font-display); font-stretch: 94%; font-weight: 620; font-size: var(--step-1); padding: 0; margin-bottom: .35rem; }
.fieldset legend + * { clear: both; }
.fieldset > .muted { margin-bottom: 1rem; max-width: 62ch; }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .field__label { font-weight: 600; font-size: .95rem; }
.field > label.check { font-weight: 400; }
.field__opt { font-weight: 400; color: var(--ink-muted); }
.field__hint { font-size: var(--step--1); color: var(--ink-muted); }
.field__error { font-size: var(--step--1); color: var(--danger-ink); font-weight: 600; display: flex; gap: .35rem; align-items: flex-start; }

.input, .select, textarea.input {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: inherit; line-height: 1.35;
}
textarea.input { min-height: 6rem; resize: vertical; }
.input::placeholder { color: #7D8885; }
.input:hover, .select:hover { border-color: var(--ink-soft); }
.input:focus, .select:focus { outline: none; border-color: #3F7BD9; box-shadow: 0 0 0 3px rgba(63, 123, 217, .25); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger-ink); background: #FFF9F8; }
.select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2346555A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; background-size: 1.1rem; }
.input--code { font-variant-numeric: tabular-nums; letter-spacing: .04em; text-transform: uppercase; }

.choice-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 2.6rem; padding: .45rem .95rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.choice input:checked + span { border-color: var(--shutter); background: var(--shutter-tint); color: var(--shutter-hover); font-weight: 650; box-shadow: inset 0 0 0 1px var(--shutter); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--shutter); flex: none; }

.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.5rem; }

/* segmented control (filtri a scelta singola) */
.segmented { margin: 0; padding: 0; min-width: 0; display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: .5rem .85rem; cursor: pointer; white-space: nowrap; }
.segmented label + label span { border-left: 1px solid var(--line); }
.segmented input:checked + span { background: var(--ink); color: #fff; font-weight: 600; }
.segmented input:focus-visible + span { box-shadow: inset 0 0 0 3px #3F7BD9; }

/* ---------------------------------------------------------------- combobox luoghi */
.combo { position: relative; }
.combo__list {
  position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: 0 14px 30px -14px rgba(28, 41, 45, .4); max-height: 18rem; overflow: auto;
}
.combo__list[hidden] { display: none; }
.combo__option { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .6rem; border-radius: var(--r-xs); cursor: pointer; }
.combo__option[aria-selected="true"], .combo__option:hover { background: var(--shutter-tint); }
.combo__option small { color: var(--ink-muted); }
.combo__status { padding: .5rem .6rem; color: var(--ink-muted); font-size: var(--step--1); }

/* ---------------------------------------------------------------- tabella prenotazioni */
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: 1.25rem; }
.filters .field { flex: 0 1 12rem; }
.filters .field--grow { flex: 1 1 16rem; }
.filters .check { align-self: center; }
.filters__more { display: contents; }
.filters__toggle { display: none; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: var(--step--1); color: var(--ink-muted); padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: #F4F6F1; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { position: relative; }
.table tbody tr:hover { background: #F6F8F3; }
.table .guest-cell a { color: var(--ink); font-weight: 650; text-decoration: none; }
.table .guest-cell a::after { content: ""; position: absolute; inset: 0; }
.table .guest-cell a:hover { text-decoration: underline; }
.table .guest-cell a:focus-visible { box-shadow: none; }
.table tr:focus-within { box-shadow: inset 0 0 0 2px #3F7BD9; }
.table .num { text-align: right; }
.date-pair { display: flex; gap: .4rem; align-items: baseline; white-space: nowrap; }
.date-pair b { font-weight: 650; }
.is-cancelled td { color: var(--ink-muted); }
.is-cancelled .guest-cell a { text-decoration: line-through; color: var(--ink-muted); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ---------------------------------------------------------------- dettaglio prenotazione */
.stay-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: end; margin-bottom: 1.75rem; }
.stay-dates { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-top: .7rem; color: var(--ink-soft); }
.stay-dates strong { color: var(--ink); font-weight: 650; }

.guest-list { list-style: none; margin: 0; padding: 0; }
.guest-list > li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .85rem; align-items: start; padding: 1rem 1.35rem; }
.guest-list > li + li { border-top: 1px solid var(--line); }
.guest-list .member { padding-left: 3.5rem; }
.guest-mark { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--plaster-deep); font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.guest-mark--ok { background: var(--ok-bg); color: var(--ok-ink); }
.guest-mark--todo { background: var(--warn-bg); color: var(--warn-ink); }
.guest-name { font-weight: 650; }
.guest-facts { display: flex; flex-wrap: wrap; gap: .1rem 1rem; color: var(--ink-muted); font-size: var(--step--1); margin-top: .15rem; }
.guest-problems { margin: .45rem 0 0; padding: 0; list-style: none; color: var(--warn-ink); font-size: var(--step--1); font-weight: 600; }

.progress-line { display: flex; align-items: center; gap: .75rem; }
.progress-line__bar { flex: 1; height: .45rem; background: var(--plaster-deep); border-radius: 999px; overflow: hidden; }
.progress-line__bar span { display: block; height: 100%; background: var(--shutter); border-radius: inherit; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.steps li::before { content: counter(step); width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ink); font-family: var(--font-display); font-weight: 700; }
.steps li.done::before { content: "✓"; background: var(--shutter); border-color: var(--shutter); color: #fff; }
.steps h3 { margin-top: .3rem; }
.steps p { color: var(--ink-soft); margin-top: .25rem; }

.history { list-style: none; margin: 0; padding: 0; font-size: var(--step--1); }
.history li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px dashed var(--line); }

details.disclosure > summary { cursor: pointer; font-weight: 650; color: var(--shutter); list-style: none; display: inline-flex; align-items: center; gap: .4rem; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
details.disclosure[open] > summary::before { transform: rotate(45deg); }
details.disclosure > .disclosure__body { margin-top: .9rem; }

/* ---------------------------------------------------------------- strutture */
.structure-list { display: grid; gap: 1.25rem; }
.unit-block { border-top: 1px solid var(--line); padding: 1.25rem 1.35rem; }
.unit-block:first-child { border-top: 0; }
.unit-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.unit-block__name { font-family: var(--font-display); font-stretch: 92%; font-weight: 640; font-size: var(--step-1); }
.calendars { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.calendars li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem .8rem; background: #F4F6F1; border-radius: var(--r-sm); }
.calendars .sync-state { font-size: var(--step--1); color: var(--ink-muted); flex: 1 1 14rem; }
.calendars .sync-state--error { color: var(--danger-ink); font-weight: 600; }
.danger-zone { border-color: #E3B8B1; }

/* ---------------------------------------------------------------- TABLEAU */
.board-tools { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.board-nav { display: flex; gap: .4rem; align-items: center; }
.board-range { font-family: var(--font-display); font-stretch: 90%; font-weight: 640; font-size: var(--step-1); margin: 0 .5rem; }

.board {
  --days: 21; --half: 1.45rem; --label-w: 11.5rem; --lane-h: 2.35rem;
  position: relative; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  scrollbar-width: thin; overscroll-behavior-x: contain;
}
.board__grid {
  position: relative; display: grid;
  min-width: calc(var(--label-w) + var(--days) * 2 * var(--half));
  grid-template-columns: var(--label-w) repeat(calc(var(--days) * 2), minmax(var(--half), 1fr));
}
.board__corner, .board__unit { position: sticky; left: 0; z-index: 3; background: var(--paper); border-right: 1px solid var(--line); }
.board__corner { grid-column: 1; border-bottom: 1px solid var(--line-strong); }
.board__day {
  grid-column: span 2; text-align: center; padding: .45rem 0 .4rem; border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line); font-size: var(--step--1); line-height: 1.15; color: var(--ink-soft);
}
.board__day b { display: block; font-size: var(--step-0); color: var(--ink); font-weight: 650; }
.board__day--weekend { background: #F1F3EE; }
.board__day--today { background: var(--ink); color: #DCE5DF; border-left-color: var(--ink); }
.board__day--today b { color: #fff; }
.board__day--month { border-left: 2px solid var(--ink-soft); }

.board__unit { grid-column: 1; padding: .55rem .9rem; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); min-height: calc(var(--lane-h) + .5rem); }
.board__unit b { font-weight: 650; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board__unit small { color: var(--ink-muted); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board__cell { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.board__cell--weekend { background: #F4F6F1; }
.board__cell--today { background: #E6ECE8; }
.board__cell--month { border-left: 2px solid var(--ink-soft); }
.board__lanes { display: contents; }

/* La targhetta: foro a sinistra (giorno di arrivo), coda arrotondata (partenza) */
.tag {
  --c: var(--p-other);
  z-index: 2; align-self: center; height: calc(var(--lane-h) - .55rem); margin: .25rem 0;
  display: flex; align-items: center; gap: .45rem; min-width: 0; overflow: hidden; padding: 0 .75rem 0 1.25rem;
  background: var(--c); color: #fff; text-decoration: none; position: relative;
  border-radius: 3px 999px 999px 3px; font-size: var(--step--1); line-height: 1.1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .16);
}
.tag::before {
  content: ""; position: absolute; left: .45rem; top: 50%; width: .45rem; height: .45rem; margin-top: -.225rem;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .25);
}
.tag--done::before { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.tag:hover { color: #fff; filter: brightness(1.08); text-decoration: none; }
.tag:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px #3F7BD9; }
.tag b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 1.5rem; }
.tag span { opacity: .82; white-space: nowrap; overflow: hidden; flex: 0 1000 auto; min-width: 0; }
.tag--airbnb { --c: var(--p-airbnb); }
.tag--booking { --c: var(--p-booking); }
.tag--direct { --c: var(--p-direct); }
.tag--vrbo { --c: var(--p-vrbo); }
.tag--clip-left { border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: .6rem; }
.tag--clip-left::before { display: none; }
.tag--clip-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tag--block {
  background: repeating-linear-gradient(135deg, #CBD2C6 0 5px, #DDE2D8 5px 10px);
  color: var(--ink-soft); box-shadow: inset 0 0 0 1px #B9C1B3; border-radius: 3px;
}
.tag--block::before { display: none; }
.tag--block:hover { color: var(--ink); }

.board-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; font-size: var(--step--1); color: var(--ink-soft); align-items: center; }
.board-legend .key { display: inline-flex; align-items: center; gap: .4rem; }
.board-legend .swatch { width: 1.6rem; height: .75rem; border-radius: 2px 999px 999px 2px; background: var(--pc); }
.board-legend .swatch--block { background: repeating-linear-gradient(135deg, #CBD2C6 0 4px, #DDE2D8 4px 8px); border-radius: 2px; }

/* ---------------------------------------------------------------- dialog */
dialog.confirm {
  border: 0; border-radius: var(--r-md); padding: 0; width: min(28rem, calc(100vw - 2rem));
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(28, 41, 45, .55);
}
dialog.confirm::backdrop { background: rgba(28, 41, 45, .45); }
dialog.confirm .confirm__body { padding: 1.4rem 1.5rem .5rem; }
dialog.confirm .confirm__body p { margin-top: .5rem; color: var(--ink-soft); }
dialog.confirm .confirm__actions { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem 1.4rem; }

/* ---------------------------------------------------------------- accesso */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(24rem, 1fr); }
.auth__side { background: var(--ink); color: #DDE5DF; padding: 2.5rem clamp(1.5rem, 4vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; overflow: hidden; }
.auth__side .brand { font-size: 1.5rem; }
.auth__claim { font-family: var(--font-display); font-stretch: 78%; font-weight: 650; font-size: clamp(2rem, 1.2rem + 2.4vw, 3.2rem); line-height: 1.02; color: #fff; max-width: 14ch; letter-spacing: -0.02em; }
.auth__note { max-width: 38ch; color: #B9C6BF; }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 2.5rem var(--page-pad); }
.auth__form { width: 100%; max-width: 25rem; }
.auth__form h1 { margin-bottom: .4rem; }
.auth__form > form { margin-top: 1.5rem; display: grid; gap: 1.1rem; }
.auth__switch { margin-top: 1.5rem; color: var(--ink-soft); }

/* mini tableau illustrativo */
.demo-board { display: grid; grid-template-columns: repeat(14, 1fr); gap: .55rem 0; max-width: 34rem; }
.demo-board i { height: 1.35rem; border-radius: 3px 999px 999px 3px; position: relative; display: block; }
.demo-board i::before { content: ""; position: absolute; left: .35rem; top: 50%; width: .35rem; height: .35rem; margin-top: -.175rem; border-radius: 50%; background: var(--ink); }
.demo-board .gap { height: 1.35rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .main-nav, .header-new { display: none; }
  .site-header__inner { gap: 1rem; }
  .account-menu summary .account-name { display: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--paper); border-top: 1px solid var(--line-strong);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    color: var(--ink-muted); text-decoration: none; font-size: .78rem; font-weight: 600; position: relative;
  }
  .tabbar a .icon { width: 1.45rem; height: 1.45rem; }
  .tabbar a[aria-current="page"] { color: var(--shutter); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--shutter); }
  .tabbar a:focus-visible { box-shadow: inset 0 0 0 3px #3F7BD9; border-radius: 0; }
  .page { padding-bottom: calc(var(--tabbar-h) + 3rem); }

  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth__side { padding: 1.1rem var(--page-pad); }
  .auth__main { align-items: flex-start; padding-top: 2rem; }
  .auth__side .auth__claim, .auth__side .demo-board, .auth__side .auth__note { display: none; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid > [class*="span-"] { grid-column: auto; }
  .stay-head { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: .4rem minmax(0, 1fr); }
  .row__side { grid-column: 2; justify-content: flex-start; }
  .board { --half: 1.3rem; --label-w: 7.5rem; }

  /* tabella -> elenco */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: .8rem 1rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; }
  .table td { padding: 0; border: 0; }
  .table td[data-cell="guest"] { grid-column: 1 / -1; order: -2; }
  .table td[data-cell="dates"] { order: -1; grid-column: 1 / -1; color: var(--ink-soft); }
  .table td[data-cell="nights"], .table td[data-cell="guests"] { display: none; }
  .filters .field, .filters .field--grow { flex: 1 1 100%; }
  .filters__toggle { display: inline-flex; }
  .filters__toggle[aria-expanded="true"] { --bg: var(--shutter-tint); --bd: var(--shutter); }
  .filters__more { display: flex; flex-wrap: wrap; gap: .75rem; flex: 1 1 100%; order: 5; }
  .filters__more[hidden] { display: none; }
  .segmented { display: flex; width: 100%; }
  .segmented label { flex: 1; text-align: center; }
  .guest-list > li { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .guest-list > li > .btn-row { grid-column: 2; }
  .guest-list .member { padding-left: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .tabbar, .page-head__actions, .btn { display: none !important; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- pulizie */
.cleaning { display: grid; gap: 1.75rem; max-width: 52rem; }
.cleaning-day h2 { font-size: var(--step-1); margin-bottom: .6rem; display: flex; gap: .6rem; align-items: baseline; }
.cleaning-day h2 span { font-family: var(--font-ui); font-weight: 400; font-size: var(--step-0); color: var(--ink-muted); }
.row__stripe.cleaning-urgent { background: var(--warn-ink); }

/* ---------------------------------------------------------------- console di piattaforma */
.site-header--console { background: #3B2F45; }
.site-header--console .main-nav a[aria-current="page"] { border-bottom-color: #D9C7E6; }
.console-back { --bg: transparent; --fg: #EDE4F2; --bd: #6E5E7B; }
.console-back:hover { --bg: #4A3C55; --bd: #D9C7E6; color: #fff; }
.header-actions form { margin: 0; }
.facts th { background: none; color: var(--ink); font-size: var(--step-0); font-weight: 400; }
.facts td { font-weight: 650; }
@media (max-width: 860px) { .console-nav { display: flex; } .console-nav a { padding: 0 .5rem; } .site-header--console .brand { font-size: 1.1rem; } }
@media (max-width: 720px) { .console-nav { overflow-x: auto; } }

/* banda dell'assistenza: deve essere impossibile non notarla */
.support-band { background: #F2C66D; color: #3D2800; border-bottom: 2px solid #C9952B; }
.support-band__inner { max-width: 92rem; margin: 0 auto; padding: .6rem var(--page-pad); display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.support-band__inner .icon { width: 1.3rem; height: 1.3rem; }
.support-band p { flex: 1 1 22rem; }
.support-band form { margin: 0; }
.support-band .btn { --bg: #3D2800; --fg: #fff; --bd: #3D2800; }
