/* /agenda — layout split: calendar + sidebar with next 3 business days. */

.agenda-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-header .sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  max-width: 700px;
}
.page-header .t-agent { color: var(--accent-2); }

.agenda-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

/* ===================== CALENDAR ===================== */
.cal-card,
.side-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  color: var(--text);
}
.cal-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-nav:hover {
  background: var(--accent-soft);
  color: var(--accent-2);
  border-color: var(--accent);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.cal-weekdays span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: center;
  font-weight: 500;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  user-select: none;
}
.cal-day:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.cal-day.empty {
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.cal-day.weekend {
  color: var(--text-dim);
  background: transparent;
}
.cal-day.past {
  color: var(--text-dim);
  opacity: 0.4;
}
.cal-day.today {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
  font-weight: 600;
}
.cal-day.has-appt {
  border-color: var(--accent);
}
.cal-day.has-appt::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-day.has-appt.today::after { background: var(--accent-2); }
.cal-day.selected {
  background: var(--accent);
  color: #1a1d22;
  border-color: var(--accent-2);
  font-weight: 600;
}
.cal-day.selected::after { background: #1a1d22; }
.cal-day .count-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  background: var(--accent);
  color: #1a1d22;
  border-radius: 99px;
  padding: 1px 5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cal-day.selected .count-badge { background: #1a1d22; color: var(--accent); }

.cal-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-dim);
  align-items: center;
}
.cal-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.cal-legend .dot.today { background: var(--accent-soft); border: 1px solid var(--accent); }
.cal-legend .dot.has-appt { background: var(--accent); }
.cal-legend .dot.weekend { background: var(--text-dim); opacity: 0.4; }

/* ===================== SIDEBAR ===================== */
.side-card { padding: 20px; }
.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.side-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}
.side-window {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 99px;
}
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-loading { color: var(--text-dim); font-size: 13px; padding: 8px 0; }

.side-day {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.side-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.side-day-name {
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text);
}
.side-day-date {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.side-day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
}
.pill.booked { background: rgba(94, 167, 255, 0.12); color: #95b5ff; border-color: rgba(94, 167, 255, 0.3); }
.pill.free   { background: rgba(74, 222, 128, 0.10); color: var(--ok); border-color: rgba(74, 222, 128, 0.25); }
.pill.empty  { background: transparent; color: var(--text-dim); border-style: dashed; }

.side-day-bookings {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.booking {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
.booking-line { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.booking-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-2);
}
.booking-name { color: var(--text); }
.booking-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Detail panel (when a calendar day is clicked) */
.side-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-back {
  background: transparent;
  border: 0;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  align-self: flex-start;
  font-family: inherit;
}
.side-detail-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-transform: capitalize;
}
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ============== MOBILE ============== */
@media (max-width: 920px) {
  .agenda-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .agenda-main { padding: 22px 16px 40px; }
  .page-header h1 { font-size: 22px; }
  .cal-card, .side-card { padding: 16px; border-radius: 14px; }
  .cal-day { font-size: 13px; }
  .cal-title { font-size: 15px; }
  .cal-weekdays span { font-size: 10px; }
}
