:root {
  --bg: #080b12;
  --bg-soft: #0e1420;
  --panel: rgba(255, 255, 255, .075);
  --panel-strong: rgba(255, 255, 255, .12);
  --text: #f8fafc;
  --muted: #9ca3af;
  --line: rgba(255,255,255,.13);
  --accent: #7dd3fc;
  --accent-2: #c084fc;
  --danger: #fb7185;
  --success: #86efac;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
  --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(125,211,252,.24), transparent 28rem),
    radial-gradient(circle at top right, rgba(192,132,252,.18), transparent 30rem),
    linear-gradient(135deg, #070a11 0%, #111827 55%, #070a11 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); background: rgba(8,11,18,.72); border-bottom: 1px solid var(--line); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 850; letter-spacing: -.02em; }
.logo-mark { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07111f; box-shadow: 0 10px 35px rgba(125,211,252,.22); }
.nav-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; min-height: 44px; font-weight: 800; color: #07111f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 15px 35px rgba(125,211,252,.16); }
.btn.secondary { color: var(--text); background: rgba(255,255,255,.09); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: rgba(251,113,133,.14); color: #fecdd3; border: 1px solid rgba(251,113,133,.35); box-shadow: none; }

.hero { padding: 78px 0 54px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) 430px; gap: 36px; align-items: center; }
.kicker { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 900; }
h1, h2, h3 { letter-spacing: -.055em; line-height: .98; }
h1 { margin: 0; font-size: clamp(44px, 7vw, 84px); }
h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); }
h3 { margin: 0; font-size: 28px; }
.lead { color: #cbd5e1; line-height: 1.7; font-size: 18px; max-width: 760px; }
.panel, .hero-card { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.055)); border-radius: var(--radius); box-shadow: var(--shadow); }
.visual-card { min-height: 310px; padding: 28px; display: grid; place-items: center; overflow: hidden; }
.calendar-preview { width: 100%; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; transform: rotate(-3deg); }
.calendar-preview span { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.11); }
.calendar-preview .busy { background: rgba(125,211,252,.42); }
.calendar-preview .closed { background: rgba(251,113,133,.36); }
.calendar-preview .ferie { background: rgba(134,239,172,.35); }

.calendar-wrap { padding: 32px 0 70px; }
.calendar-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; color: #dbeafe; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.055); }
.dot { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.dot.appointment, .event-appointment { --event: rgba(125,211,252,.2); --event-border: rgba(125,211,252,.45); }
.dot.closed, .event-closed { --event: rgba(251,113,133,.18); --event-border: rgba(251,113,133,.42); }
.dot.ferie, .event-ferie { --event: rgba(134,239,172,.18); --event-border: rgba(134,239,172,.42); }
.dot.riposo, .event-riposo { --event: rgba(253,186,116,.18); --event-border: rgba(253,186,116,.42); }
.dot.unavailable, .event-unavailable { --event: rgba(192,132,252,.18); --event-border: rgba(192,132,252,.42); }
.dot.appointment { background: #7dd3fc; }.dot.closed { background: #fb7185; }.dot.ferie { background: #86efac; }.dot.riposo { background: #fdba74; }.dot.unavailable { background: #c084fc; }

.month-jump { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0 16px; scrollbar-width: thin; }
.month-jump a { flex: 0 0 auto; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: #e5e7eb; border-radius: 999px; padding: 10px 14px; font-weight: 800; font-size: 14px; }
.horizontal-help { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.month-controls { display: flex; justify-content: flex-end; gap: 10px; margin: 0 0 14px; }
.month-control { width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.09); color: var(--text); font-size: 22px; cursor: pointer; }
.months-scroll { overflow-x: auto; overflow-y: hidden; padding: 6px 4px 22px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.months { display: flex; gap: 24px; width: max-content; }
.month { width: min(1040px, calc(100vw - 48px)); flex: 0 0 min(1040px, calc(100vw - 48px)); padding: 24px; scroll-snap-align: start; }
.month-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.weekdays div { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; text-align: center; padding-bottom: 6px; }
.day { min-height: 118px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); border-radius: 18px; padding: 10px; overflow: hidden; }
.day.empty { background: rgba(255,255,255,.018); border-style: dashed; }
.day-number { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 999px; color: #e2e8f0; font-weight: 900; font-size: 13px; background: rgba(255,255,255,.075); margin-bottom: 7px; }
.event, .badge { display: block; border-radius: 13px; background: var(--event, rgba(255,255,255,.1)); border: 1px solid var(--event-border, var(--line)); color: #f8fafc; padding: 7px 8px; margin-top: 6px; font-size: 12px; font-weight: 850; line-height: 1.25; }
.event small { display: block; color: #dbeafe; margin-top: 3px; font-weight: 700; }
.badge { display: inline-flex; margin: 0; }
.footer { border-top: 1px solid var(--line); color: var(--muted); padding: 28px 0; }

.admin-layout { padding: 46px 0 70px; }
.grid-admin { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.admin-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.admin-form { padding: 28px; }
.form-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 30px; }
.form-grid { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: block; font-size: 13px; font-weight: 900; color: #dbeafe; margin-bottom: 7px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.07); color: var(--text); padding: 13px 14px; outline: none; font: inherit; }
select option { background: #111827; color: #fff; }
textarea { min-height: 116px; resize: vertical; }
.notice { border: 1px solid rgba(251,113,133,.35); background: rgba(251,113,133,.12); color: #fecdd3; border-radius: 18px; padding: 13px 15px; margin: 0 0 16px; }
.notice.success { border-color: rgba(134,239,172,.35); background: rgba(134,239,172,.12); color: #dcfce7; }
.events-table { padding: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #dbeafe; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.stats { display: grid; gap: 12px; margin-top: 18px; }
.stat { border: 1px solid var(--line); background: rgba(255,255,255,.055); border-radius: 18px; padding: 16px; }
.stat strong { display: block; font-size: 22px; }.stat span { color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid, .grid-admin { grid-template-columns: 1fr; }
  .calendar-header, .admin-title { align-items: flex-start; flex-direction: column; }
  .legend { justify-content: flex-start; }
  .row { grid-template-columns: 1fr; }
  .day { min-height: 92px; padding: 7px; border-radius: 14px; }
  .event { font-size: 11px; padding: 6px; }
  .month { padding: 16px; }
}


.field-help { color: var(--muted); font-size: 13px; margin-top: 7px; }
select#event_type { cursor: pointer; font-weight: 800; border-color: rgba(125,211,252,.45); background: rgba(15,23,42,.96); }
select#event_type:focus { box-shadow: 0 0 0 4px rgba(125,211,252,.16); }

.day:has(.event-riposo) { border-color: rgba(253,186,116,.36); background: rgba(253,186,116,.06); }
.event-riposo { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }

/* Mobile responsive upgrade */
img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.months-scroll { -webkit-overflow-scrolling: touch; }
.months-scroll:focus { outline: 2px solid rgba(125,211,252,.45); outline-offset: 4px; }

@media (max-width: 760px) {
  :root { --radius: 20px; }
  body {
    background:
      radial-gradient(circle at top left, rgba(125,211,252,.18), transparent 20rem),
      linear-gradient(135deg, #070a11 0%, #111827 100%);
  }
  .container { width: min(100% - 22px, 1180px); }
  .topbar { position: sticky; }
  .nav {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .logo { font-size: 15px; }
  .logo-mark { width: 38px; height: 38px; border-radius: 13px; }
  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .nav-links .btn, .admin-title .btn, .actions .btn, button.btn {
    width: 100%;
  }
  .btn {
    min-height: 46px;
    padding: 12px 14px;
    text-align: center;
  }

  .hero { padding: 38px 0 26px; }
  .hero-grid { gap: 18px; }
  h1 { font-size: clamp(34px, 12vw, 52px); line-height: 1.02; }
  h2 { font-size: clamp(28px, 9vw, 38px); }
  h3 { font-size: 24px; }
  .lead { font-size: 16px; line-height: 1.55; }
  .visual-card { display: none; }

  .calendar-wrap { padding: 22px 0 42px; }
  .calendar-header { gap: 14px; }
  .legend {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    font-size: 12px;
  }
  .legend span { justify-content: flex-start; padding: 9px 10px; }
  .month-jump {
    margin-left: -11px;
    margin-right: -11px;
    padding: 10px 11px 14px;
    scroll-snap-type: x proximity;
  }
  .month-jump a { scroll-snap-align: start; font-size: 13px; padding: 10px 13px; }
  .horizontal-help {
    background: rgba(255,255,255,.07);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 11px 13px;
    line-height: 1.35;
  }
  .month-controls {
    position: sticky;
    left: 0;
    justify-content: space-between;
    gap: 12px;
  }
  .month-control { width: 50%; height: 48px; font-size: 26px; }

  /* On mobile the calendar stays readable by scrolling left/right, not stacked vertically. */
  .months-scroll {
    margin-left: -11px;
    margin-right: -11px;
    padding: 6px 11px 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-left: 11px;
  }
  .months { gap: 14px; }
  .month {
    width: 760px;
    flex: 0 0 760px;
    padding: 16px;
    border-radius: 20px;
  }
  .weekdays, .days { gap: 7px; }
  .weekdays div { font-size: 11px; }
  .day {
    min-height: 106px;
    padding: 8px;
    border-radius: 15px;
  }
  .day-number { width: 26px; height: 26px; font-size: 12px; margin-bottom: 5px; }
  .event, .badge {
    font-size: 11px;
    padding: 6px 7px;
    border-radius: 11px;
    line-height: 1.22;
  }
  .event small { font-size: 10px; }
  .footer { font-size: 13px; padding: 22px 0; }

  .admin-layout { padding: 24px 0 42px; }
  .admin-title { gap: 14px; margin-bottom: 16px; }
  .admin-title .actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .grid-admin { gap: 16px; }
  .admin-form, .login-card, .hero-card { padding: 18px; }
  .form-page { align-items: start; padding: 16px 11px; }
  .row { grid-template-columns: 1fr; gap: 12px; }
  input, select, textarea { min-height: 46px; font-size: 16px; border-radius: 14px; }
  textarea { min-height: 104px; }
  label { font-size: 12px; }
  .field-help { font-size: 12px; line-height: 1.35; }
  .notice { border-radius: 15px; font-size: 13px; line-height: 1.4; }
  .events-table {
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  table, thead, tbody, th, td, tr { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tr {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.055));
    padding: 12px;
    box-shadow: 0 14px 36px rgba(0,0,0,.22);
  }
  td {
    border-bottom: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  td:nth-child(1)::before { content: 'Data'; }
  td:nth-child(2)::before { content: 'Orario'; }
  td:nth-child(3)::before { content: 'Tipo'; }
  td:nth-child(4)::before { content: 'Cliente'; }
  td:nth-child(5)::before { content: 'Pubblico'; }
  td:nth-child(6)::before { content: 'Azioni'; }
  td::before {
    color: #dbeafe;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  td .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .inline-form { width: 100%; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
}

@media (max-width: 420px) {
  .container { width: min(100% - 18px, 1180px); }
  .legend { grid-template-columns: 1fr; }
  .month {
    width: 700px;
    flex-basis: 700px;
  }
  .day { min-height: 100px; }
  td { grid-template-columns: 88px minmax(0, 1fr); }
}

/* Vera vista mobile: non è la griglia desktop rimpicciolita. */
.mobile-agenda-scroll { display: none; }

@media (max-width: 760px) {
  .months-scroll { display: none; }
  .mobile-agenda-scroll {
    display: block;
    margin-left: -11px;
    margin-right: -11px;
    padding: 6px 11px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 11px;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-agenda-months {
    display: flex;
    gap: 14px;
    width: max-content;
  }
  .mobile-month-card {
    width: calc(100vw - 22px);
    max-width: calc(100vw - 22px);
    flex: 0 0 calc(100vw - 22px);
    scroll-snap-align: start;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.055));
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .mobile-month-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(14,20,32,.96);
    backdrop-filter: blur(14px);
  }
  .mobile-month-sticky h3 {
    margin: 0 0 6px;
    font-size: 29px;
  }
  .mobile-month-sticky small {
    color: var(--muted);
    font-weight: 750;
  }
  .mobile-days-list {
    display: grid;
    gap: 10px;
    padding: 14px;
    max-height: 68vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-day-card {
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(255,255,255,.055);
    border-radius: 18px;
    padding: 13px;
    display: grid;
    gap: 10px;
  }
  .mobile-day-card.has-events {
    border-color: rgba(251,113,133,.34);
    background: rgba(251,113,133,.08);
  }
  .mobile-day-head {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mobile-date-number {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, rgba(125,211,252,.28), rgba(192,132,252,.22));
    border: 1px solid rgba(255,255,255,.12);
    font-weight: 950;
    font-size: 18px;
  }
  .mobile-day-head strong,
  .mobile-day-head span {
    display: block;
  }
  .mobile-day-head strong {
    font-size: 15px;
  }
  .mobile-day-head span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
  }
  .mobile-day-status {
    width: fit-content;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .01em;
  }
  .mobile-day-status.free {
    color: #dcfce7;
    background: rgba(134,239,172,.13);
    border: 1px solid rgba(134,239,172,.28);
  }
  .mobile-day-status.blocked {
    color: #fecdd3;
    background: rgba(251,113,133,.16);
    border: 1px solid rgba(251,113,133,.34);
  }
  .mobile-events-list {
    display: grid;
    gap: 7px;
  }
  .mobile-event-pill {
    border-radius: 14px;
    padding: 9px 10px;
    background: var(--event, rgba(255,255,255,.1));
    border: 1px solid var(--event-border, var(--line));
    font-size: 13px;
    font-weight: 900;
  }
  .mobile-event-pill span,
  .mobile-event-pill small {
    display: block;
  }
  .mobile-event-pill small {
    color: #dbeafe;
    margin-top: 3px;
  }
  .horizontal-help::before {
    content: 'Vista telefono attiva: ';
    color: var(--accent);
    font-weight: 950;
  }
}

@media (max-width: 420px) {
  .mobile-month-card {
    width: calc(100vw - 18px);
    flex-basis: calc(100vw - 18px);
  }
  .mobile-days-list { max-height: 66vh; padding: 12px; }
  .mobile-month-sticky { padding: 16px; }
}


/* Fix mobile portrait: show a real phone layout, never a blank calendar. */
@media screen and (max-width: 760px) {
  #calendario,
  #calendario .container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 1px !important;
    overflow: visible !important;
  }

  #monthsScroll {
    display: none !important;
  }

  #mobileAgendaScroll {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 360px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 4px 0 24px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
  }

  #mobileAgendaScroll .mobile-agenda-months {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    width: max-content !important;
    min-width: 100% !important;
    align-items: stretch !important;
  }

  #mobileAgendaScroll .mobile-month-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: calc(100vw - 22px) !important;
    min-width: calc(100vw - 22px) !important;
    max-width: calc(100vw - 22px) !important;
    flex: 0 0 calc(100vw - 22px) !important;
    min-height: 420px !important;
    height: auto !important;
    overflow: hidden !important;
    scroll-snap-align: start !important;
  }

  #mobileAgendaScroll .mobile-days-list {
    display: grid !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 18px !important;
  }

  #mobileAgendaScroll .mobile-day-card {
    display: grid !important;
    visibility: visible !important;
  }
}

@media screen and (max-width: 420px) {
  #mobileAgendaScroll .mobile-month-card {
    width: calc(100vw - 18px) !important;
    min-width: calc(100vw - 18px) !important;
    max-width: calc(100vw - 18px) !important;
    flex-basis: calc(100vw - 18px) !important;
  }
}

/* Mobile: mostra solo i bollini, senza scritte dentro ai giorni. */
@media (max-width: 760px) {
  .mobile-day-status {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    width: auto !important;
    min-width: 18px;
    min-height: 18px;
  }

  .mobile-status-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .mobile-status-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: rgba(255,255,255,.38);
    box-shadow: 0 0 0 4px rgba(255,255,255,.06);
  }

  .mobile-status-dot.event-free {
    background: #86efac;
    box-shadow: 0 0 0 4px rgba(134,239,172,.14);
  }

  .mobile-status-dot.event-appointment {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245,158,11,.15);
  }

  .mobile-status-dot.event-ferie {
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56,189,248,.15);
  }

  .mobile-status-dot.event-riposo,
  .mobile-status-dot.event-closed {
    background: #fb7185;
    box-shadow: 0 0 0 4px rgba(251,113,133,.16);
  }

  .mobile-event-pill,
  .mobile-events-list {
    display: none !important;
  }
}

/* Calendar replica layout: one month visible at a time, PC and mobile */
.compact-hero { padding-bottom: 28px; }
.hero-actions { margin-top: 24px; }
.clean-preview span { position: relative; background: rgba(255,255,255,.08); }
.clean-preview span::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 999px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 4px rgba(255,255,255,.28), 0 6px 16px rgba(0,0,0,.22);
}
.clean-preview .free::after { background: #3c9f35; }
.clean-preview .appointment::after { background: #2563eb; }
.clean-preview .ferie::after { background: #f5820b; }
.clean-preview .riposo::after { background: #ffd400; }
.clean-preview .closed::after { background: #d60012; }

.calendar-replica-wrap { padding-top: 18px; }
.calendar-shell {
  background: #f8fafc;
  color: #071426;
  border: 1px solid rgba(2, 6, 23, .12);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0,0,0,.34);
  padding: 28px;
  overflow: hidden;
}
.calendar-toolbar {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.calendar-current {
  text-align: center;
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: .08em;
  color: #082849;
}
.calendar-arrow {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: #082849;
  color: #fff;
  cursor: pointer;
  font-size: 34px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(8,40,73,.22);
}
.calendar-arrow:disabled { opacity: .32; cursor: not-allowed; }
.calendar-slides { position: relative; }
.replica-month { display: none; }
.replica-month.is-active { display: block; }
.replica-title {
  display: none;
  margin: 0 0 20px;
  text-align: center;
  font-size: clamp(38px, 5.4vw, 70px);
  color: #082849;
  letter-spacing: .09em;
  font-weight: 950;
}
.replica-weekdays, .replica-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.replica-weekdays {
  background: #082849;
  color: #fff;
  border: 1px solid #cbd5e1;
  border-bottom: 0;
}
.replica-weekdays div {
  text-align: center;
  font-weight: 950;
  font-size: 16px;
  letter-spacing: .02em;
  padding: 14px 8px;
  border-right: 1px solid rgba(255,255,255,.45);
}
.replica-weekdays div:last-child { border-right: 0; }
.replica-days { border-left: 1px solid #cbd5e1; border-top: 1px solid #cbd5e1; }
.replica-day {
  min-height: 118px;
  background: #fff;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  position: relative;
  padding: 12px;
}
.replica-day.is-empty { background: #f8fafc; }
.replica-number {
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
  color: #071426;
}
.replica-dot, .legend-dot {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  box-shadow: inset 0 3px 6px rgba(255,255,255,.35), 0 4px 10px rgba(0,0,0,.18);
}
.replica-dot {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
}
.dot-appointment { background: #2563eb; }
.dot-ferie { background: #f5820b; }
.dot-riposo { background: #ffd400; }
.dot-free { background: #3c9f35; }
.dot-closed { background: #d60012; }
.replica-day.is-today { outline: 3px solid #082849; outline-offset: -3px; }
.replica-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
  color: #071426;
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
}
.replica-legend span { display: inline-flex; align-items: center; gap: 12px; }
.replica-legend .legend-dot { width: 30px; height: 30px; }

@media (max-width: 900px) {
  .calendar-shell { padding: 16px; border-radius: 16px; }
  .calendar-toolbar { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; }
  .calendar-arrow { width: 44px; height: 44px; font-size: 28px; }
  .calendar-current { font-size: clamp(22px, 7vw, 36px); letter-spacing: .04em; }
  .replica-weekdays div {
    font-size: 0;
    padding: 10px 2px;
  }
  .replica-weekdays div::first-letter { font-size: 12px; }
  .replica-day { min-height: 62px; padding: 6px; }
  .replica-number { font-size: 15px; }
  .replica-dot { width: 14px; height: 14px; top: 62%; }
  .replica-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    font-size: 12px;
    margin-top: 16px;
    justify-items: start;
  }
  .replica-legend span { gap: 7px; }
  .replica-legend .legend-dot { width: 14px; height: 14px; }
}

@media (max-width: 480px) {
  .container { width: min(100% - 14px, 1180px); }
  .calendar-shell { padding: 10px; border-radius: 14px; }
  .calendar-toolbar { grid-template-columns: 38px minmax(0, 1fr) 38px; margin-bottom: 8px; }
  .calendar-arrow { width: 38px; height: 38px; font-size: 25px; }
  .calendar-current { font-size: clamp(19px, 7vw, 28px); }
  .replica-weekdays div { padding: 8px 1px; }
  .replica-weekdays div::first-letter { font-size: 10px; }
  .replica-day { min-height: 50px; padding: 5px; }
  .replica-number { font-size: 13px; }
  .replica-dot { width: 11px; height: 11px; top: 64%; }
  .replica-legend { font-size: 11px; gap: 8px; }
  .replica-legend .legend-dot { width: 12px; height: 12px; }
}
