/* Calendar page: month, week and agenda views. */
.cal-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

/* Month grid */
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, minmax(96px, 1fr));
  height: var(--cal-h);
  min-height: 640px;
}
.cal-dow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.cal-day {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}
.cal-day:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: color-mix(in srgb, var(--gray-soft) 40%, transparent); }
.cal-day.other .cal-num { opacity: .4; }
.cal-num {
  font-size: 13.5px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  align-self: flex-start;
}
.cal-day.today .cal-num { background: var(--accent); color: #fff; }

/* Event chips (shared by month, week and agenda) */
.cal-ev {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--ev) 16%, var(--panel));
  border-left: 3px solid var(--ev);
  color: var(--ink);
  text-decoration: none;
}
.cal-ev:hover { background: color-mix(in srgb, var(--ev) 28%, var(--panel)); text-decoration: none; }
.cal-ev.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; opacity: .85; }
.cal-time { font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cal-more {
  font-size: 12px;
  color: var(--accent);
  border: 0;
  background: none;
  padding: 0 4px;
  text-align: left;
  cursor: pointer;
}
.cal-contact { display: block; color: var(--muted); font-size: 12px; }
.cal-empty { color: var(--muted); text-align: center; }

/* Week view */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: var(--cal-h);
  min-height: 560px;
}
.cal-col {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow: auto;
  min-width: 0;
}
.cal-col:last-child { border-right: 0; }
.cal-col-head {
  text-align: center;
  padding: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}
.cal-col-date {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 2px auto 0;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 999px;
}
.cal-col.today .cal-col-date { background: var(--accent); color: #fff; }
.cal-ev.big { white-space: normal; padding: 8px 10px; font-size: 13px; }

/* Agenda view */
.cal-agenda-day {
  position: sticky;
  top: 0;
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.cal-agenda-row {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ev); flex: none; }

@media (max-width: 860px) {
  .cal-month { grid-template-rows: auto repeat(6, minmax(64px, 1fr)); height: auto; min-height: 0; }
  .cal-time { display: none; }
  .cal-week { grid-template-columns: 1fr; height: auto; }
}

/* Toolbar: one row (wraps on narrow screens). */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h2 { margin: 0 8px; font-size: 20px; min-width: 190px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .seg { margin-left: auto; }
.cal-ev.big > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.big .cal-time { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.cal-ev.big .cal-contact { font-size: 12px; color: var(--muted); }
.cal-empty { color: var(--muted); text-align: center; padding: 8px 0; opacity: .5; }
@media (min-width: 1600px) { .cal-ev { font-size: 13.5px; padding: 4px 8px; } .cal-num { font-size: 15px; min-width: 30px; height: 30px; } .cal-dow { font-size: 13px; } }
@media (min-width: 2200px) { .cal-ev { font-size: 14.5px; } .toolbar h2 { font-size: 24px; } }

/* Who and which gear on each booking (everyone sees all bookings) */
.cal-who { opacity: .75; font-weight: 400; }
.cal-gear { display: flex; align-items: flex-start; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.35; white-space: normal; }
.cal-gear svg { flex: none; margin-top: 2px; }
.cal-agenda-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ev.mine { box-shadow: inset 3px 0 0 var(--ev, var(--accent)); font-weight: 600; }
