
/* ===============================
   CALENDAR – WEEK GRID (FINAL)
   =============================== */

.calendar-shell {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* Toolbar */
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calendar-toolbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* GRID */
.week-grid {
  display: flex;
  position: relative;
  height: 780px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

/* Time column */
.time-col {
  width: 70px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

.time-cell {
  height: 60px;
  padding: 6px 8px;
  font-size: 12px;
  color: #475569;
  border-bottom: 1px solid #eef2f7;
}

/* Scroll area */
.week-scroll {
  display: flex;
  flex: 1;
  width: 100%;
  overflow-x: hidden;
}

/* Days (Mo–Sa fill full width) */
.day-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  background: #ffffff;
}

.day-col.is-today {
  background: #eef6ff;
}

.day-head {
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 6px;
  background: #f1f5f9;
  border-bottom: 1px solid #e5e7eb;
  color: #1e293b;
}

/* Staff */
.day-body {
  display: flex;
  flex: 1;
}

.staff-col {
  flex: 1;
  min-width: 0;
  position: relative;
  border-left: 1px solid #eef2f7;
  background:
    repeating-linear-gradient(
      to bottom,
      #ffffff,
      #ffffff 60px,
      #f8fafc 60px,
      #f8fafc 120px
    );
}

.staff-head {
  position: sticky;
  top: 0;
  z-index: 3;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px;
  background: #ffffff;
  color: #334155;
  border-bottom: 1px solid #e5e7eb;
}

/* Appointments */
.appt {
  position: absolute;
  left: 6px;
  right: 6px;
  background: var(--appt-color, #4f46e5);
  color: #ffffff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  cursor: grab;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  user-select: none;
}

.appt:active {
  cursor: grabbing;
}

.appt strong {
  display: block;
  font-weight: 700;
  font-size: 13px;
}

.appt span {
  font-size: 12px;
  opacity: .9;
}

/* Manual appointments */
.appt.is-manual {
  outline: 2px dashed rgba(255,255,255,.6);
}

.appt-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
}

/* Resize handle */
.appt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}

/* Now line */
.now-line {
  position: absolute;
  left: 70px;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 5;
  pointer-events: none;
}

.now-line::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
}

/* Hint */
.calendar-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #475569;
}

/* Responsive */
@media (max-width: 900px) {
  .appt {
    font-size: 12px;
  }
}

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

  .week-grid {
    height: 620px;
  }

  .time-col {
    width: 54px;
  }

  .time-cell {
    font-size: 11px;
  }
}
