/* ==========================================================================
   Giorgia's Style — foglio di stile unico per sito pubblico e gestionale
   ========================================================================== */

:root {
  --bg: #f8f3ea;
  --bg-deep: #f1e8da;
  --surface: #fffdf9;
  --surface-2: #fdf8f1;
  --ink: #241f1b;
  --ink-soft: #4a4038;
  --muted: #7c6d5c;
  --line: #e5d8c6;
  --line-strong: #d6c5ad;
  --accent: #7a2338;
  --accent-dark: #5e1a2a;
  --accent-soft: #f7e9ec;
  --gold: #b89150;
  --ok: #2c6a4c;
  --ok-soft: #e7f2ec;
  --warn: #8a5a12;
  --warn-soft: #fbf0dc;
  --bad: #a32a2a;
  --bad-soft: #fbe9e7;
  --info: #2f5d7c;
  --info-soft: #e8f1f7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -28px rgba(56, 38, 20, .45);
  --shadow-soft: 0 2px 0 rgba(56, 38, 20, .04), 0 12px 28px -24px rgba(56, 38, 20, .5);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 239, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 74px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.32rem;
  color: var(--ink);
  letter-spacing: .01em;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: .45rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand small {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: .2rem;
  margin-left: auto;
}

.nav a:not(.btn) {
  color: var(--ink-soft);
  padding: .5rem .75rem;
  border-radius: 999px;
  font-size: .93rem;
  text-decoration: none;
}
.nav a:not(.btn):hover { background: var(--bg-deep); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: .6rem; }

/* -------------------------------------------------------------------- btn */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-deep); color: var(--ink); }

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.btn-soft:hover { background: #f2dde2; color: var(--accent-dark); }

.btn-tel { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-tel:hover { background: var(--bg-deep); color: var(--accent-dark); }
.btn-tel svg { flex: 0 0 auto; }

.btn-sm {
  min-height: 34px;
  padding: .3rem .7rem;
  font-size: .82rem;
  border-radius: 8px;
}
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ flash */

.flashes { display: grid; gap: .5rem; margin: 1.1rem 0 0; }

.flash {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .93rem;
}
.flash-success { background: var(--ok-soft); border-color: #c3ddcf; color: #1f4d37; }
.flash-error { background: var(--bad-soft); border-color: #efc9c4; color: #7d1f1f; }
.flash-info { background: var(--info-soft); border-color: #c9ddea; color: #24495f; }

/* ------------------------------------------------------------------- hero */

.hero { position: relative; overflow: hidden; padding: clamp(2.4rem, 5vw, 4.6rem) 0 clamp(2rem, 4vw, 3.4rem); }
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 40% 40%, rgba(184, 145, 80, .22), rgba(184, 145, 80, 0) 62%);
  z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }

.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow);
}
.hero-card h3 { font-size: .95rem; font-family: var(--sans); font-weight: 700; letter-spacing: .01em; }
.hero-card .hours-mini { list-style: none; margin: 0; padding: 0; }
.hero-card .hours-mini li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .38rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: .9rem;
}
.hero-card .hours-mini li:last-child { border-bottom: 0; }
.hero-card .hours-mini span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hero-card .closed { color: var(--muted); font-style: italic; }
.hero-card .call-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}
.hero-card .call-box a { font-size: 1.12rem; font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------------- sezioni */

.section { padding: clamp(2.4rem, 5vw, 4rem) 0; }
.section-alt { background: var(--bg-deep); border-block: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.section-head p { color: var(--muted); margin: 0; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  text-decoration: none;
  color: inherit;
}
.service-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); text-decoration: none; }
.service-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.service-card .sc-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.service-card h3 { font-size: 1.06rem; margin: 0; }
.service-card .price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.service-card .desc { font-size: .88rem; color: var(--muted); margin: 0; }
.service-card .meta { margin-top: auto; padding-top: .6rem; font-size: .8rem; color: var(--muted); letter-spacing: .03em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; counter-reset: step; }
.step { position: relative; padding-top: 2.4rem; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--accent);
}
.step h3 { font-size: 1.02rem; }
.step p { font-size: .92rem; color: var(--muted); margin: 0; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.contact-card h3 { font-size: .8rem; font-family: var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.contact-card .big-link { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); display: inline-block; }
.contact-card .big-link:hover { color: var(--accent); text-decoration: none; }
.contact-card p { margin: 0 0 .35rem; color: var(--ink-soft); }

.hours-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours-table th, .hours-table td { text-align: left; padding: .42rem 0; border-bottom: 1px dashed var(--line); font-weight: 400; }
.hours-table th { color: var(--ink-soft); }
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; }
.hours-table tr:last-child th, .hours-table tr:last-child td { border-bottom: 0; }
.hours-table .closed { color: var(--muted); font-style: italic; }
.hours-table tr.is-today th, .hours-table tr.is-today td { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: auto;
  background: #211c18;
  color: #d7cbbc;
  padding: 2.6rem 0 1.6rem;
}
.site-footer a { color: #f0e3d2; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-family: var(--sans); margin-bottom: .7rem; }
.site-footer p, .site-footer li { font-size: .9rem; color: #b6a795; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: #a1927f; }
.footer-bottom {
  margin-top: 2.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid #3a322b;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: #93867a;
}

/* --------------------------------------------------------------- footer cta */

.mobile-call {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 45;
  justify-content: center;
  box-shadow: 0 14px 30px -12px rgba(36, 31, 27, .5);
}

/* -------------------------------------------------------------- prenota */

.booking-head { padding: 2rem 0 1rem; }
.booking-head p { color: var(--muted); max-width: 62ch; margin: 0; }

.booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  gap: 1.6rem;
  align-items: start;
  padding-bottom: 3rem;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.panel + .panel { margin-top: 1.1rem; }

.step-title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.step-title .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.step-title h2 { font-size: 1.12rem; margin: 0; }
.step-title .hint { margin-left: auto; font-size: .78rem; color: var(--muted); }

.service-row { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x proximity; }
.service-pill {
  flex: 0 0 auto;
  min-width: 168px;
  max-width: 220px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .75rem .85rem;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.service-pill:hover { border-color: var(--line-strong); text-decoration: none; }
.service-pill[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.service-pill .sp-name { font-weight: 600; font-size: .95rem; display: block; }
.service-pill .sp-meta { font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; margin-top: .2rem; }

.day-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem 0 .6rem; scroll-snap-type: x proximity; }
.day {
  flex: 0 0 auto;
  min-width: 64px;
  padding: .5rem .35rem .45rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  text-align: center;
  color: inherit;
  text-decoration: none;
  scroll-snap-align: start;
  transition: border-color .15s, background .15s;
}
.day:hover { border-color: var(--line-strong); text-decoration: none; }
.day[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.day.is-closed { opacity: .45; }
.day .d-wd { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day .d-n { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.25; }
.day .d-free { display: block; font-size: .66rem; color: var(--ok); }
.day .d-free.none { color: var(--muted); }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .5rem; }
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.slot:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.slot[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty-note {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .92rem;
}
.empty-note strong { color: var(--ink); display: block; margin-bottom: .25rem; font-family: var(--serif); font-size: 1rem; }

/* ------------------------------------------------------------- form base */

.field { display: flex; flex-direction: column; gap: .34rem; margin-bottom: .95rem; }
.field label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.field .help { font-size: .78rem; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="time"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 35, 56, .12);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: #fffafa; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237c6d5c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  padding-right: 2.1rem;
}

.field-error { color: var(--bad); font-size: .8rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--ink-soft); }
.checkbox input { width: 18px; height: 18px; min-height: 0; margin: .15rem 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.checkbox a { text-decoration: underline; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------- summary */

.summary { position: sticky; top: 92px; }
.summary-card {
  background: #221d19;
  color: #efe5d8;
  border-radius: var(--radius);
  padding: 1.35rem;
}
.summary-card h2 { color: #fff; font-size: 1.08rem; margin-bottom: 1rem; }
.summary-list { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: .7rem; }
.summary-list li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; border-bottom: 1px solid #382f28; padding-bottom: .6rem; }
.summary-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list .k { color: #a4978a; }
.summary-list .v { text-align: right; color: #fff; font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: .4rem; }
.summary-total .amount { font-family: var(--serif); font-size: 1.5rem; color: #fff; }
.summary-note { font-size: .78rem; color: #a4978a; margin: 1rem 0 0; }
.summary-call {
  margin-top: 1rem;
  display: block;
  background: #2e2721;
  border-radius: var(--radius-sm);
  padding: .8rem .9rem;
  color: #efe5d8;
  text-decoration: none;
  font-size: .84rem;
}
.summary-call:hover { background: #3a312a; text-decoration: none; }
.summary-call strong { display: block; color: #fff; font-size: 1.02rem; }

/* ------------------------------------------------------------ conferma */

.done-card { text-align: center; padding: clamp(1.6rem, 4vw, 3rem); }
.done-check {
  width: 58px; height: 58px; margin: 0 auto 1.1rem;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center;
}
.done-card h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); }
.done-card .lead { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.ticket {
  margin: 1.8rem auto 0;
  max-width: 480px;
  text-align: left;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1.2rem 1.3rem;
}
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .92rem; }
.ticket dt { color: var(--muted); }
.ticket dd { margin: 0; text-align: right; font-weight: 600; }
.ticket .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.done-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.6rem; }

/* --------------------------------------------------------------- 404/err */

.error-page { padding: clamp(3rem, 8vw, 6rem) 0; text-align: center; }
.error-page p { color: var(--muted); max-width: 48ch; margin-inline: auto; }

/* ==========================================================================
   GESTIONALE
   ========================================================================== */

.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.admin-side {
  background: #221d19;
  color: #d8ccbd;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-side .brand { color: #fff; font-size: 1.15rem; }
.admin-side .brand small { display: block; margin-top: .2rem; color: #9c8d7c; font-size: .58rem; }
.admin-nav { display: grid; gap: .15rem; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .58rem .7rem;
  border-radius: 9px;
  color: #cfc2b2;
  font-size: .9rem;
  text-decoration: none;
}
.admin-nav a:hover { background: #2e2721; color: #fff; text-decoration: none; }
.admin-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.admin-nav .ico { width: 18px; display: inline-grid; place-items: center; opacity: .85; }
.admin-nav .count {
  margin-left: auto;
  background: #f5e6c8;
  color: #5a3c10;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: .05rem .42rem;
}
.admin-nav a[aria-current="page"] .count { background: #fff; color: var(--accent-dark); }
.admin-side .side-foot { margin-top: auto; border-top: 1px solid #3a322b; padding-top: .9rem; font-size: .8rem; }
.admin-side .side-foot .who { color: #fff; font-weight: 600; display: block; }
.admin-side .side-foot .mail { color: #9c8d7c; font-size: .76rem; word-break: break-all; }
.admin-side .side-foot form { margin-top: .7rem; }

.admin-main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 3rem; min-width: 0; }
.admin-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.admin-top h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0; }
.admin-top .sub { color: var(--muted); font-size: .88rem; margin: .15rem 0 0; }
.admin-top .top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.4rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1.05rem;
}
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; margin-top: .15rem; }
.stat .v small { font-family: var(--sans); font-size: .78rem; color: var(--muted); font-weight: 400; }
.stat.is-warn .v { color: var(--warn); }
.stat.is-accent { background: var(--accent-soft); border-color: #eccfd6; }
.stat.is-accent .v { color: var(--accent-dark); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 1.1rem; align-items: start; }
.admin-col { display: grid; gap: 1.1rem; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h2 { font-size: 1.02rem; margin: 0; }
.card-head a, .card-head .link { font-size: .82rem; }
.card-note { font-size: .82rem; color: var(--muted); margin: -.4rem 0 .9rem; }

/* agenda */

.agenda { list-style: none; margin: 0; padding: 0; display: grid; }
.agenda li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.agenda li:last-child { border-bottom: 0; }
.agenda .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .92rem; }
.agenda .who { font-weight: 600; font-size: .92rem; }
.agenda .what { color: var(--muted); font-size: .8rem; }
.agenda .end { color: var(--muted); font-size: .74rem; }

.pill {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill[hidden] { display: none; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-muted { background: #eee8df; color: #6f6357; }
.pill-done { background: var(--info-soft); color: var(--info); }
.pill-info { background: var(--info-soft); color: var(--info); }

/* tabella */

.table-scroll { overflow-x: auto; margin: 0 -.3rem; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
table.table th, table.table td { text-align: left; padding: .62rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .sub { display: block; color: var(--muted); font-size: .78rem; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; letter-spacing: .04em; }

/* filtri */

.filters { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .8rem; align-items: end; }
.filters .field { margin-bottom: 0; grid-column: span 3; }
.filters .field.w-2 { grid-column: span 2; }
.filters .field.w-4 { grid-column: span 4; }
.filters .field.full { grid-column: 1 / -1; }
.filters .actions { grid-column: span 3; display: flex; gap: .5rem; align-items: flex-end; }

/* calendario */

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
.week-day { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .55rem; min-height: 240px; }
.week-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.week-day.is-closed { background: repeating-linear-gradient(135deg, #f6f0e6, #f6f0e6 8px, #f1e9dc 8px, #f1e9dc 16px); }
.week-day .wd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.week-day .wd-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.week-day .wd-num { font-family: var(--serif); font-size: 1.15rem; }
.week-day .closed-tag { font-size: .72rem; color: var(--muted); font-style: italic; }
.week-day .appt {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 7px;
  padding: .4rem .45rem;
  margin-bottom: .4rem;
  font-size: .78rem;
  color: inherit;
  text-decoration: none;
}
.week-day .appt:hover { border-color: var(--line-strong); text-decoration: none; }
.week-day .appt.is-confirmed { border-left-color: var(--ok); }
.week-day .appt.is-completed { border-left-color: var(--info); }
.week-day .appt time { font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.week-day .appt .nm { display: block; margin-top: .1rem; }
.week-day .appt .sv { color: var(--muted); font-size: .72rem; display: block; }

/* orari (admin) */

.hours-editor { display: grid; gap: .6rem; }
.hours-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: .88rem;
}
.hours-row .wd { font-weight: 600; }
.hours-row .slots { display: flex; flex-wrap: wrap; gap: .4rem; }
.hours-row .slot-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .18rem .3rem .18rem .6rem;
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
}
.hours-row .slot-chip form { margin: 0; display: inline-flex; }
.hours-row .slot-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 50%;
}
.hours-row .slot-chip button:hover { color: var(--bad); background: var(--bad-soft); }

/* notifiche */

.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.notif {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  background: var(--surface-2);
}
.notif.unread { background: #fff; border-color: #e8cdd4; border-left: 3px solid var(--accent); }
.notif .nt { font-weight: 600; font-size: .9rem; }
.notif .nb { font-size: .82rem; color: var(--ink-soft); white-space: pre-line; margin-top: .2rem; }
.notif .nm { font-size: .74rem; color: var(--muted); margin-top: .3rem; }

/* messaggi */

details.msg { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: .3rem .7rem; }
details.msg summary { cursor: pointer; font-size: .88rem; padding: .35rem 0; display: flex; gap: .6rem; align-items: center; }
details.msg summary::-webkit-details-marker { color: var(--muted); }
details.msg .msg-body {
  white-space: pre-wrap;
  font-size: .82rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .7rem .8rem;
  margin: .3rem 0 .7rem;
  max-height: 340px;
  overflow: auto;
}
details.msg .msg-meta { font-size: .76rem; color: var(--muted); margin-bottom: .5rem; }

/* ---------------------------------------------------------------- login */

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background:
  radial-gradient(circle at 20% 10%, rgba(184,145,80,.18), transparent 45%),
  radial-gradient(circle at 80% 90%, rgba(122,35,56,.14), transparent 45%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.8rem; box-shadow: var(--shadow); }
.auth-card .brand { display: block; text-align: center; margin-bottom: .3rem; font-size: 1.6rem; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: .86rem; margin-bottom: 1.5rem; }
.auth-card .btn { margin-top: .4rem; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 1.2rem; }

/* --------------------------------------------------------------- utility */

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 600; }
.mono-num { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .8rem; }
.mt-2 { margin-top: 1.4rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { text-align: right; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; border: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.inline-form { display: inline; margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 1.6rem .8rem; font-size: .9rem; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .booking-grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem .8rem; }
  .admin-side .brand { flex: 0 0 auto; }
  .admin-nav { display: flex; overflow-x: auto; gap: .2rem; order: 3; width: 100%; padding-bottom: .2rem; }
  .admin-nav a { white-space: nowrap; padding: .45rem .6rem; font-size: .84rem; }
  .admin-nav .ico { display: none; }
  .admin-side .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: .5rem; }
  .admin-side .side-foot .who, .admin-side .side-foot .mail { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .site-header .wrap { min-height: 64px; gap: .6rem; }
  .nav a:not(.btn) { display: none; }
  .brand small { display: none; }
  .brand { font-size: 1.15rem; }
  .nav { margin-left: auto; gap: .35rem; }
  .nav .btn { padding: .5rem .85rem; font-size: .86rem; }
  .nav .btn-tel .label { display: none; }
  .nav .btn-tel { padding: .55rem .8rem; }
  .field-row { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field, .filters .field.w-2, .filters .field.w-4, .filters .actions { grid-column: span 1; }
  .filters .actions { grid-column: 1 / -1; }
  .hours-row { grid-template-columns: 1fr; gap: .45rem; }
  .mobile-call { display: flex; }
  .site-footer { padding-bottom: 4.6rem; }
  .agenda li { grid-template-columns: 48px minmax(0, 1fr); }
  .agenda li .agenda-tail { grid-column: 2; justify-self: start; }
  .admin-main { padding-bottom: 4rem; }
}

/* ------------------------------------------------------------------ ritocchi */

/* I servizi vanno a capo sul desktop: lo scorrimento orizzontale resta solo su mobile. */
@media (min-width: 721px) {
  .service-row { flex-wrap: wrap; overflow: visible; }
  .service-pill { flex: 1 1 190px; max-width: 260px; }
}

.hours-mini li.is-today span:first-child { color: var(--accent); font-weight: 600; }
.hours-mini li.is-today span:last-child { color: var(--accent); }

.pending-list { display: grid; }
.pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pending-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pending-info strong { display: block; font-size: .9rem; }
.pending-info .sub { display: block; font-size: .8rem; color: var(--muted); }

.mono { white-space: nowrap; }
.filters .actions.w-2 { grid-column: span 2; }

@media (max-width: 560px) {
  .step-title { flex-wrap: wrap; }
  .step-title .hint { display: none; }
  .booking-grid { padding-bottom: 4.5rem; }
  .summary-card { padding: 1.1rem; }
  .summary-list li { font-size: .86rem; }
  .done-card { padding: 1.4rem 1rem; }
  .ticket { padding: 1rem; }
  .ticket dl { grid-template-columns: 1fr; gap: .15rem; }
  .ticket dd { text-align: left; margin-bottom: .55rem; }
  .done-actions .btn { width: 100%; }
}

@media (max-width: 560px) {
  .stat .v { font-size: 1.45rem; }
  .stat .v small { display: block; margin-top: .1rem; font-size: .72rem; }
  .admin-top .top-actions { width: 100%; }
  .admin-top .top-actions .btn { flex: 1 1 auto; }
  .week-day { min-height: 0; }
  .notif .nb { font-size: .8rem; }
}

/* ------------------------------------------------------ notifiche browser */

.notify-card {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid #eccfd6;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  flex-wrap: wrap;
}
.notify-copy { max-width: 46ch; }
.notify-copy h2 { font-size: 1.02rem; margin-bottom: .25rem; }
.notify-copy p { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.notify-action { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.notify-action .btn { min-height: 40px; background: var(--surface); }
.notify-action p { margin: 0; max-width: 34ch; }
.notify-action p[data-tone="error"] { color: var(--bad); }
.notify-action p[data-tone="info"] { color: var(--muted); }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: .82rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn[hidden] { display: none; }
.btn[hidden] { display: none; }

@media (max-width: 640px) {
  .notify-card { flex-direction: column; align-items: stretch; }
  .notify-action .btn { width: 100%; }
}
