/* ==========================================================================
   CENTRO EVENTI — DESIGN SYSTEM
   Questa sezione può essere estratta integralmente in styles.css.
   ========================================================================== */

:root {
  --brand-navy: #113957;
  --brand-navy-dark: #0b2b44;
  --brand-blue: #1b5b80;
  --brand-orange: #ed6b3b;
  --brand-orange-soft: #fff0e9;
  --brand-cream: #f8f5ef;
  --ink: #1a2731;
  --muted: #687885;
  --line: #dce5ea;
  --surface: #ffffff;
  --surface-soft: #f5f8fa;
  --success: #16794d;
  --warning: #a96d0d;
  --danger: #b42318;
  --info: #256b92;
  --page-bg: #edf2f5;
  --shadow-sm: 0 10px 30px rgba(13, 43, 66, .07);
  --shadow-lg: 0 28px 85px rgba(13, 43, 66, .16);
  --radius-sm: 11px;
  --radius-md: 16px;
  --radius-lg: 23px;
  --content-max: 1580px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(17,57,87,.035), transparent 220px),
    radial-gradient(circle at 0 0, rgba(237,107,59,.085), transparent 27%),
    var(--page-bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  color: #fff;
  background:
    linear-gradient(108deg, var(--brand-navy-dark), var(--brand-navy) 62%, #174c70);
  box-shadow: 0 12px 35px rgba(8,31,49,.18);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 82px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.identity-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand-navy);
  font-weight: 950;
  letter-spacing: -.04em;
  box-shadow: inset 0 0 0 1px rgba(17,57,87,.12);
}

.identity-copy small {
  display: block;
  margin-bottom: 4px;
  color: #ffc0a4;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.identity-copy h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
}

.identity-copy p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.67);
  font-size: 11px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-pill {
  display: none;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
  font-size: 11px;
  white-space: nowrap;
}

.button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  font-weight: 850;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--brand-orange); box-shadow: 0 10px 24px rgba(237,107,59,.22); }
.button.light { color: var(--brand-navy); background: #fff; }
.display-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.button.secondary { color: var(--brand-navy); background: var(--surface-soft); border: 1px solid var(--line); }
.button.danger { color: var(--danger); background: #fff0ef; border: 1px solid #efc9c5; }

.workspace {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 28px 56px;
}

.intro-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px 19px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.intro-strip strong { color: var(--brand-navy); }
.intro-strip span { color: var(--muted); font-size: 11px; line-height: 1.5; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 106px;
  padding: 18px 19px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 17px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.metric::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: var(--metric-color, var(--brand-navy));
  opacity: .07;
}

.metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--brand-navy);
  font-size: 31px;
  line-height: 1;
}

.metric em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(255,255,255,.92);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.93);
  box-shadow: var(--shadow-lg);
}

.calendar-panel {
  min-width: 0;
  padding: 21px;
  overflow-x: auto;
}

/* Mini-colonna 08–20 nel margine destro dei giorni della vista mensile. */
#calendar .fc-dayGridMonth-view {
  min-width: 870px;
}

#calendar .fc-daygrid-day-frame {
  position: relative;
  min-height: 132px;
  padding-right: 39px;
}

.day-occupancy {
  position: absolute;
  z-index: 3;
  top: 34px;
  right: 6px;
  bottom: 9px;
  width: 29px;
  min-height: 70px;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}

.day-occupancy:hover,
.day-occupancy:focus-visible {
  filter: saturate(1.2);
  transform: scale(1.08);
  outline: none;
}

.day-occupancy-rail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 13px;
  border: 1px solid rgba(17,57,87,.13);
  border-radius: 999px;
  background:
    linear-gradient(to bottom, transparent 49%, rgba(17,57,87,.18) 49%, rgba(17,57,87,.18) 51%, transparent 51%),
    rgba(17,57,87,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.day-occupancy-hour {
  position: absolute;
  left: 0;
  width: 14px;
  color: #61737f;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.day-occupancy-hour.start { top: 0; transform: translateY(-35%); }
.day-occupancy-hour.middle { top: 50%; transform: translateY(-50%); }
.day-occupancy-hour.end { bottom: 0; transform: translateY(35%); }

.day-occupancy-hour::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  width: 3px;
  height: 1px;
  background: #8796a0;
}

.day-occupancy-block {
  position: absolute;
  left: 2px;
  right: 2px;
  min-height: 5px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.8);
  pointer-events: none;
}

#calendar .fc-day-other .day-occupancy {
  opacity: .32;
}

/* Orologio centrale degli impegni. */
.clock-modal {
  width: min(960px, 100%);
  overflow: hidden;
}

.clock-modal-head small {
  display: block;
  margin-bottom: 5px;
  color: #ffc0a4;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.clock-modal-head h2 {
  text-transform: capitalize;
}

.clock-body {
  padding: 20px 24px 25px;
  background:
    radial-gradient(circle at 28% 45%, rgba(27,91,128,.08), transparent 35%),
    #f7fafb;
}

.clock-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(280px, .95fr);
  gap: 27px;
  align-items: center;
}

.clock-stage {
  display: grid;
  place-items: center;
  min-width: 0;
}

.clock-svg {
  display: block;
  width: min(100%, 500px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 20px 34px rgba(13,43,66,.12));
}

.clock-face {
  fill: #fff;
  stroke: #d7e2e8;
  stroke-width: 2;
}

.clock-guide {
  fill: none;
  stroke: rgba(17,57,87,.1);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.clock-tick {
  stroke: #a8b6bf;
  stroke-width: 1;
}

.clock-tick.major {
  stroke: #617986;
  stroke-width: 2.5;
}

.clock-hour-label {
  fill: #607581;
  font-size: 10px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
}

.clock-event-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  cursor: pointer;
  filter: drop-shadow(0 3px 3px rgba(13,43,66,.18));
  transition: stroke-width .15s ease, filter .15s ease;
}

.clock-event-arc:hover,
.clock-event-arc:focus {
  stroke-width: 20;
  filter: drop-shadow(0 4px 5px rgba(13,43,66,.26));
  outline: none;
}

.clock-center {
  fill: var(--brand-navy);
  stroke: #fff;
  stroke-width: 7;
  filter: drop-shadow(0 8px 13px rgba(13,43,66,.2));
}

.clock-center-day,
.clock-center-month,
.clock-center-count {
  fill: #fff;
  text-anchor: middle;
}

.clock-center-day {
  font-size: 34px;
  font-weight: 950;
}

.clock-center-month {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
}

.clock-center-count {
  fill: rgba(255,255,255,.7);
  font-size: 8px;
  font-weight: 800;
}

.clock-event-list {
  min-width: 0;
  max-height: 470px;
  overflow-y: auto;
  padding: 5px 7px 5px 0;
}

.clock-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 0 2px;
}

.clock-list-heading strong {
  color: var(--brand-navy);
  font-size: 14px;
}

.clock-list-heading span {
  color: var(--muted);
  font-size: 8px;
}

.clock-list-event {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
  padding: 12px 12px 12px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}

.clock-list-event::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--clock-event-color);
}

.clock-list-event:hover {
  transform: translateX(3px);
  border-color: color-mix(in srgb, var(--clock-event-color) 42%, var(--line));
}

.clock-list-time {
  color: var(--clock-event-color);
  font-size: 10px;
  font-weight: 950;
}

.clock-list-copy {
  min-width: 0;
}

.clock-list-copy strong,
.clock-list-copy small {
  display: block;
}

.clock-list-copy strong {
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-list-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel {
  position: sticky;
  top: 102px;
  overflow: hidden;
}

.side-head {
  padding: 19px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.side-head h2 { margin: 0; color: var(--brand-navy); font-size: 18px; }
.side-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.side-body { max-height: 685px; overflow: auto; padding: 10px 12px 14px; }

.mini-event {
  position: relative;
  margin: 8px 0;
  padding: 13px 13px 13px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}

.mini-event::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-orange);
}

.mini-event:hover { transform: translateY(-1px); border-color: #c8d6de; }
.mini-event strong { display: block; color: var(--brand-navy); font-size: 13px; line-height: 1.3; }
.mini-event span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.empty { padding: 30px 18px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7,22,33,.68);
  backdrop-filter: blur(7px);
}

.overlay.open { display: flex; }

.modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 35px 110px rgba(0,0,0,.31);
}

.modal.small { width: min(520px, 100%); }

.modal-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 25px;
  color: #fff;
  background:
    linear-gradient(112deg, var(--brand-navy-dark), var(--brand-navy) 70%);
}

.modal-head h2 { margin: 0; font-size: 23px; }
.modal-head p { margin: 6px 0 0; color: rgba(255,255,255,.68); font-size: 11px; line-height: 1.45; }

.close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 22px;
}

.modal-body { padding: 23px 25px; }

.form-section {
  margin-bottom: 22px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-heading h3 { margin: 0; color: var(--brand-navy); font-size: 15px; }

.publication-section {
  padding: 17px;
  border: 1px solid #d5e2e9;
  border-radius: 17px;
  background: linear-gradient(135deg, #f7fafc, #eef5f8);
}

.public-event-toggle {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: center;
  cursor: pointer;
}

.public-event-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.public-toggle-control {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #b9c6ce;
  box-shadow: inset 0 0 0 1px rgba(17,57,87,.1);
  transition: background .18s ease, box-shadow .18s ease;
}

.public-toggle-control i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(13,43,66,.22);
  transition: transform .18s ease;
}

.public-event-toggle input:checked + .public-toggle-control {
  background: var(--brand-orange);
  box-shadow: 0 7px 18px rgba(237,107,59,.25);
}

.public-event-toggle input:checked + .public-toggle-control i {
  transform: translateX(20px);
}

.public-event-toggle input:focus-visible + .public-toggle-control {
  outline: 3px solid rgba(37,107,146,.25);
  outline-offset: 3px;
}

.public-toggle-copy strong,
.public-toggle-copy small {
  display: block;
}

.public-toggle-copy strong {
  color: var(--brand-navy);
  font-size: 13px;
}

.public-toggle-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.section-badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--brand-orange);
  background: var(--brand-orange-soft);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full { grid-column: 1 / -1; }

label {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-navy);
  font-size: 10px;
  font-weight: 850;
}

label.required::after { content: " *"; color: var(--brand-orange); }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

textarea {
  min-height: 104px;
  padding-top: 11px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(237,107,59,.11);
}

.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.room-box {
  display: none;
  padding: 16px;
  border: 1px solid #cadce6;
  border-radius: 15px;
  background:
    linear-gradient(180deg, #f4f9fc, #f8fbfc);
}

.room-box.visible { display: block; }

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.service {
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.service::before {
  content: "○";
  display: inline-block;
  margin-right: 7px;
  color: #9fb0bb;
}

.service.active {
  color: var(--brand-navy);
  border-color: #f3a482;
  background: var(--brand-orange-soft);
}

.service.active::before { content: "●"; color: var(--brand-orange); }

.message {
  display: none;
  margin-bottom: 15px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.45;
}

.message.show { display: block; }
.message.error { color: var(--danger); background: #fff0ef; }
.message.success { color: var(--success); background: #edf8f2; }
.message.info { color: var(--info); background: #edf6fb; }

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 25px 21px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 110;
  width: min(455px, 100%);
  height: 100vh;
  transform: translateX(105%);
  transition: transform .23s ease;
  background: #fff;
  box-shadow: -25px 0 70px rgba(7,22,33,.24);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(112deg, var(--brand-navy-dark), var(--brand-navy));
}

.drawer-head small {
  display: block;
  margin-bottom: 6px;
  color: #ffc0a4;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.drawer-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.drawer-body { height: calc(100vh - 102px); overflow-y: auto; padding: 21px 23px 28px; }

.detail {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.detail div { margin-top: 5px; font-size: 13px; line-height: 1.5; }

.owner-actions {
  display: none;
  gap: 8px;
  margin-top: 19px;
}

.owner-actions.visible { display: flex; }

.loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  place-items: center;
  background: rgba(237,242,245,.76);
  backdrop-filter: blur(4px);
}

.loading.visible { display: grid; }

.loader {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--brand-navy);
  box-shadow: var(--shadow-lg);
  font-weight: 850;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 250;
  max-width: min(520px, calc(100% - 30px));
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  color: #fff;
  background: var(--brand-navy);
  font-size: 12px;
  font-weight: 800;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

.fc .fc-toolbar { gap: 12px; margin-bottom: 18px; }
.fc .fc-toolbar-title { color: var(--brand-navy); font-size: 21px; font-weight: 900; }
.fc .fc-button-primary { border: 0!important; border-radius: 8px!important; background: var(--brand-navy)!important; box-shadow: none!important; }
.fc-theme-standard td, .fc-theme-standard th, .fc-theme-standard .fc-scrollgrid { border-color: var(--line); }
.fc .fc-col-header-cell { background: var(--surface-soft); padding: 7px 0; }
.fc .fc-col-header-cell-cushion { color: var(--brand-navy); font-size: 10px; font-weight: 900; text-transform: uppercase; text-decoration: none; }
.fc .fc-daygrid-day-number { color: var(--brand-navy); font-size: 11px; font-weight: 800; text-decoration: none; padding: 8px; }
.fc .fc-day-today { background: rgba(237,107,59,.065)!important; }
.fc .fc-daygrid-event { border: 0; border-radius: 6px; padding: 3px 5px; font-size: 10px; font-weight: 750; }

@media (max-width: 1030px) {
  .main-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .header-inner { padding: 14px 17px; align-items: flex-start; }
  .identity-copy p, .user-pill { display: none!important; }
  .workspace { padding: 16px; }
  .intro-strip { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .calendar-panel { padding: 13px; }
  .form-grid, .services { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  .owner-actions { flex-direction: column; }
  .owner-actions button { width: 100%; }
}

/* ==========================================================================
   VISTE CALENDARIO / CARD E COLORI PER TIPOLOGIA
   ========================================================================== */

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
}

.view-toolbar strong {
  display: block;
  color: var(--brand-navy);
  font-size: 13px;
}

.view-toolbar span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.view-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
}

.view-button.active {
  color: #fff;
  background: var(--brand-navy);
  box-shadow: 0 7px 16px rgba(17,57,87,.16);
}

.event-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin: 0 1px 14px;
  padding: 0 3px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.content-column {
  min-width: 0;
}

.cards-view[hidden],
#calendarView[hidden] {
  display: none !important;
}

.event-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.event-card {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: grid;
  grid-template-columns: 76px 1fr;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease;
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--event-color);
}

.event-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--event-color) 35%, var(--line));
  box-shadow: 0 20px 46px rgba(13,43,66,.13);
}

.event-card-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px 0 18px;
}

.event-type-badge,
.owner-badge,
.public-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.event-type-badge {
  color: var(--event-color);
  background: var(--event-soft);
}

.owner-badge {
  color: var(--brand-navy);
  background: #edf3f7;
}

.card-badge-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.public-badge {
  color: #9b3d1d;
  background: #fff0e9;
}

.event-card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 10px 14px 14px;
  color: var(--event-color);
}

.event-day {
  font-size: 31px;
  font-weight: 950;
  line-height: 1;
}

.event-month {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
}

.event-card-content {
  padding: 20px 17px 15px 5px;
}

.event-card-content h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 17px;
  line-height: 1.25;
}

.event-card-meta {
  display: grid;
  gap: 6px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.event-card-content p {
  margin: 14px 0 0;
  color: #526470;
  font-size: 11px;
  line-height: 1.55;
}

.event-card-content .muted-copy {
  color: #91a0aa;
}

.event-card-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px 13px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fafcfd;
  font-size: 9px;
  font-weight: 800;
}

.cards-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.fc .fc-event {
  box-shadow: 0 2px 5px rgba(13,43,66,.13);
}

.fc .fc-daygrid-event:hover {
  filter: brightness(.96);
}

@media (max-width: 1180px) {
  .event-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .view-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-switch {
    width: 100%;
  }

  .view-button {
    flex: 1;
  }

  .event-card {
    grid-template-columns: 65px 1fr;
  }

  .event-legend {
    gap: 7px 10px;
  }

  .clock-modal {
    max-height: calc(100vh - 20px);
  }

  .clock-body {
    padding: 15px;
  }

  .clock-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .clock-svg {
    width: min(100%, 360px);
  }

  .clock-event-list {
    max-height: 230px;
  }
}
